File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to represent JPanels in a JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to represent JPanels in a JPanel" Watch "How to represent JPanels in a JPanel" New topic

How to represent JPanels in a JPanel

partha phukan
Ranch Hand

Joined: Mar 13, 2011
Posts: 31
Sir/madam..., i have a problem regarding how to use JPanels inside one JPanel. i have two JPanel (panel1, panel2). I have used JSplitPane and divide them horizontally into two sides.

Now in Jpanel(panel1), i need to display another three JPanels(panel3, panel4,panel5). Now what layout should i follow..? i have tried to use Border Layout and JSplitPane but not succeeded. I need to divide them equally. What layout should i use please give me some suggestion....

Thank you in advance.
Rob Spoor

Joined: Oct 27, 2005
Posts: 19847

Equally divided usually warrants a GridLayout.

How To Ask Questions How To Answer Questions
Consider Paul's rocket mass heater.
subject: How to represent JPanels in a JPanel