Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 jpanel size
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
matt271




PostPosted: Thu Apr 16, 2009 9:27 pm   Post subject: jpanel size

in java if i have a jframe and say setSize(x, y); that will set the entire window to x by y, including the window decorations.

i want to say someMethod(x, y); and that will set the draw-on-able size to x by y. so the window size itself is greater then x by y.

i dunno if i am explaining this well?

imagine u create a jframe and say setSize(100, 100); then add a jpanel such that the jpanel covers the entire window. then say jpanel.getWidth(); and jpanel.getHeight(), they will not be 100. i want to setSize(something, something); suchthat jframe.getWidth(); will return 100.

in VB6 you could just use scalewidth and scaleheight. like form.scalewidth would return the width of drawable space on the window. u could use that to set the width to what u want. like width = width - scalewidth + realwidth. i wanna do this in java

ty Very Happy
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Fri Apr 17, 2009 4:20 pm   Post subject: RE:jpanel size

Your explanation is a bit confusing... If you setSize on a JFrame to 100, 100, you're saying that jframe.getWidth() won't return 100? Besides, if the JPanel covers the entire window, isn't it's size also 100?
matt271




PostPosted: Fri Apr 17, 2009 10:13 pm   Post subject: Re: jpanel size

no im saying a panel inside the jframe will not return 100

say i have 1 window w/ 1 panel in it. the panel covers 100% of the drawable space in the jframe

i want to make the jfame some size suchthat the panel will be 100 no matter how big the window decorations are
Bo0sT




PostPosted: Wed Apr 22, 2009 3:55 am   Post subject: Re: jpanel size

can't you just do setSize(100,100) on the jpanel?
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: