Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
How do I make a GUI that look like this? I tried GridLayout but the size of Panel A and B is always equal. How do i make something NOT equal like 30px vs 200px ......Also, I want to hand coded method. No drag and drop.
------------------------------------------
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-            JPanel A(1000px x 30px)     -
-                                        -
------------------------------------------
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-            JPanel B(1000px x 100px)    -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
-                                        -
------------------------------------------
Posted
Updated 23-Jun-13 20:32pm
v3

Try GridBagLayout instead GridLayout. See here
 
Share this answer
 
Comments
Valentine1993 24-Jun-13 3:52am    
Thank you. It works. Can i ask you a question...What does fill and weightx do?
Shubhashish_Mandal 24-Jun-13 3:58am    
all of your queries are mention in details with example in the link.
Also for you:

http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html[^]

a simple Borderlayout will do the trick.

You can also add various sized items in the Grldlayout (if needed to stay with that). IMHO the grid will render that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900