File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

two panels with cardlayout and jtoolbar always over both panels

 
sureshksks ks
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wriing a program in java using netbeans in which two panels in cardlayout over which a toolbar always over both these panels. I can use the same buttons in the toolbar for controlliong both panels. In other words If I swich to other panel i could see the same toolbar at the same place and use the same components in the toolbar. I could not find a solution . Please help. If there any other way please also explain.

Thanks in advance

suresh
 
sureshksks ks
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Everybody...
I am not getting any replies ....have I asked something which is not answerable...


suresh
 
Richard Tookey
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the Javadoc for CardLayout.next(). Read carefully!
 
sureshksks ks
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone explain with an example
my problem is the toolbar must be displayed at top of all panels. but it couldnot be placed/displayed proerly

Please help.
 
sureshksks ks
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone explain with an example
my problem is the toolbar must be displayed at top of all panels. but it couldnot be placed/displayed proerly

I am searching a solution for this last three weeks

Please help.
 
Richard Tookey
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sureshksks ks wrote:can anyone explain with an example
my problem is the toolbar must be displayed at top of all panels. but it couldnot be placed/displayed proerly
.

I thought your problem was in switching between the two panels using just one button but it now seems more fundamental. I think you need to spend more time looking at layout managers - http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html .

You seem to need a JPanel with a BorderLayout that has two children. In the NORTH position you need to place the toolbar and in the CENTRE position you need to place a second Panel that has a CardLayout. Into this second panel you place your alternate panels. I suspect the first panel should be used as the content pane of your JFrame.
 
sureshksks ks
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks richard

you lead me the right way

thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic