aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Swing master JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Swing master JFrame" Watch "Swing master JFrame" New topic
Author

Swing master JFrame

Avik Ghosh
Greenhorn

Joined: Jun 21, 2011
Posts: 2
I am new in swing. I want to create a PARENT-CHILD JFRAME, i.e I need a jpanel content side menu(tree menu) always common for all JFRAME. How can i inherit this.
Need your valuable suggestion.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4166
    
    3

Consider using a JSplitPane with a JTree as its left component and a JPanel with a CardLayout as its right component. Oh, and don't use multiple JFrames. One is enough.

More here.


luck, db
There are no new questions, but there may be new answers.
Avik Ghosh
Greenhorn

Joined: Jun 21, 2011
Posts: 2
@Darryl thankx.
If you please elaborate with some sample code..it will be great full for me.
Ho can i use the same tree menu for all JFRAMEs.
Thankx in advance
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4166
    
    3

Avik Ghosh wrote:If you please elaborate with some sample code..it will be great full for me.

There are plenty of code samples in the tutorial I gave you a link for. I don't really see a point in reproducing the tutorial here.

Avik Ghosh wrote:Ho can i use the same tree menu for all JFRAMEs.

I already told, you, don't use multiple JFrames.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32694
    
    4
And welcome to the Ranch (after your year hiding in the background)
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
are you perhaps talking about creating a frame for re-use in multiple projects?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Swing master JFrame
 
Similar Threads
ClassLoader
Layouts inside panel
How to put menu item in Title bar
Exclusively... Swing components
painting problems using JmenuBar