jpanel size
Author |
Message |
matt271
![](http://compsci.ca/v3/uploads/user_avatars/1721484549ee55140af00.png)
|
Posted: 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 Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
matt271
![](http://compsci.ca/v3/uploads/user_avatars/1721484549ee55140af00.png)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Bo0sT
![](http://compsci.ca/v3/uploads/user_avatars/86196945245bc23817a7f1.jpg)
|
Posted: Wed Apr 22, 2009 3:55 am Post subject: Re: jpanel size |
|
|
can't you just do setSize(100,100) on the jpanel? |
|
|
|
|
![](images/spacer.gif) |
|
|