• Post Reply Bookmark Topic Watch Topic
  • New Topic

link from swing page to swing page  RSS feed

 
Michail Petrov
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem

i have a JFrame with two panel and one menu

from menu i choose tipe of grafics and for every grafic i have a diferent opshan in my opshan panel i wont to mace samtinc like link
When i choos grafic one opshan panel to have component 1 or 2
and when i choose grafic 2 to appear to have diferent component in my panel





Tenck before
[ September 04, 2008: Message edited by: mixo TODOR ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like a CardLayout might suit your needs

http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html

basically, you construct 2 panels with their respective components,
then show the one linked to the menuItems
 
Michail Petrov
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i nou for CARDLAYOUT ad for Jtabpanel but i wont to do this by clicing in JMenuBar no the tabs or ComboBox
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for a cardlayout you set an identifier for each of the various panels,
then, your menuItems have actionListeners and their actionPerfomed is just
cardlayout.show(cardlayoutPanel,[identifier]);
where [identifier] represents optionPanel or graphicsPanel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!