aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Swing master JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing master JFrame" Watch "Swing master JFrame" New topic
Author

Swing master JFrame

Avik Ghosh
Greenhorn

Joined: Jun 21, 2011
Posts: 3
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: 4658
    
    5

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: 3
@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: 4658
    
    5

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: 39869
    
  28
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?
 
Don't get me started about those stupid light bulbs.
 
subject: Swing master JFrame