wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Components size    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Components size    " Watch "Components size    " New topic
Author

Components size

Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
Hi All:

I have a simple test GUI that has 2 panels (a top and a bottom),
the top panel has three components which are two Jcomboxs and one JSlider. I use GridBagLayout for the top panel. The JSlider has a fixed size by using the Dimension() function.

The bottom is an application plotting. I would think that when the GUI is launched, the full image fills the whole bottom panel height with a default zoom level of 1.0.
So my question is:
Can I define the top panel's height, then get the bottom panel's height?

therefore the bottom panel's height is

Thanks
Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
I am asking the question is because I found a partial bottom of the application is cut off even the maximum value of vertial coordinate is equal to the height of the bottom plane.
why?
Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
This is an executable SSCEE code.

From the printout result, we see the bottom Jplane size is 745 by 745.
But the path has a vertex at (250,745), which can not be displayed.
Eventhough I replaced it with (250,740) whose vertial coordinate is less than the height of the bottom Jplane.
Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
I get it, post closed.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Components size
 
Similar Threads
Having a little problem bringing up a scrollbar
ScrollPane is always a problem !!!
Trying to understand how layouts resize
Trying to resolve some odd resizing behavior of objects in GridBagLayout
BackgroundPanel.java cannot be placed in BorderLayout.NORTH