Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing master JFrame

 
Avik Ghosh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Avik Ghosh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch (after your year hiding in the background)
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you perhaps talking about creating a frame for re-use in multiple projects?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic