This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Little advice on JPanels in JFrame

 
peter hammond
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello javaRanchy's

i need a little pointer about JPanels and if that is even the best way to code...

I have a main GUI JFrame with:

menuBar -> JToolBar -> JPanel 1

what i want is create a seperate .java file for each new panel and then have update the main GUI when the selected panel is selected...

i.e

main.java
panel1.java
panel2.java
panel3.java

then in the main GUI

menuBar -> JToolBar -> JPanel 1
selected option in toolbar to show
menuBar -> JToolBar -> JPanel 2

hope that makes sence

i just want to have multiple JPanels ontop of each other then only set the one that is requested to be visable...

as a tabbed pane will have to many tabs and wont fit on the page...

any info will be a great help

many thanks
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
peter hammond wrote:i just want to have multiple JPanels ontop of each other then only set the one that is requested to be visable...


That's what CardLayout does.
 
peter hammond
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cool thanks will give it a look wasnt sure what i needed to look at... ta
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic