This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 4523
    
    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: 4523
    
    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: 37941
    
  22
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?
 
 
subject: Swing master JFrame
 
Similar Threads
painting problems using JmenuBar
ClassLoader
Exclusively... Swing components
How to put menu item in Title bar
Layouts inside panel