I'm trying to add a JButton, but it aligns horizontally with a progress bar.
How do I align the JButton on the line below?
Also, I'm trying to group all the components in separate groups, I'm not sure how to do this though. Does anyone know?
Asked
Active
Viewed 66 times
0

tckmn
- 57,719
- 27
- 114
- 156

John Smith
- 39
- 1
- 8
-
What IDE you are using?? – Maciej Cygan Sep 01 '13 at 14:05
-
Here is an example of using [combinations of layout managers](http://stackoverflow.com/a/5630271/418556). – Andrew Thompson Sep 02 '13 at 02:28
1 Answers
1
For simple splitting of a JFrame
you can use a GridLayout
with 2 rows and 2 columns.
frame.setLayout(new GridLayout(2,2,3,3)); //3,3 are gaps
frame.add(grid);
//add components here...

imulsion
- 8,820
- 20
- 54
- 84
-
+1, I liked this idea, if I understood the question correctly :-) I can not see the image, since the `imgur` server is down on my side :( – nIcE cOw Sep 01 '13 at 14:09
-
1@nIcEcOw the image is just some basic GUI components that the OP needs aligning - don't worry about it, not essential for understanding the question :) – imulsion Sep 01 '13 at 14:11
-