Soo I'm trying to make two panels and I wanted the top panel to be at least 2/3 of the window. I used GridLayout and it splits it in half, and I want to make it soo that the top is a little bit bigger. Is there another Layout I should consider instead of GridLayout?
Asked
Active
Viewed 22 times
1 Answers
2
You can use a javax.swing.JSplitPane
like:
JSplitPane spt = new JSplitPane();
spt.setDividerSize(12);
spt.setOrientation(JSplitPane.VERTICAL_SPLIT);
spt.setRightComponent(imagePanel1);
spt.setLeftComponent(imagePanel2);
spt.setDividerLocation(0.8);
And adjust the values for your necessity.

Jean Jung
- 1,200
- 12
- 29
-
Thank you soo much! Just what I was looking for – Jake Oct 10 '15 at 18:11
-
1@user2779767, `Just what I was looking for` - take a look at the [Swing Tutorial](http://docs.oracle.com/javase/tutorial/uiswing/TOC.html). If has sections on all Swing components and layout managers so you can learn about Swing functionality. Also, you may want to use the setTopComponent(...) and setBottomComponent(...) methods since that would be more appropriate for a vertical split. – camickr Oct 10 '15 at 18:20