• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Invisible Jpanels with jmenu

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I am in need of help here.
I making a aplication that are using menus.
Every jMenuItem you click will get you a new jpanel with its items (buttons, labels).

From what i have read i should be using Actionevent thing.
But i cant make it work.

Here is the code (part of the code).


That was the actionlistener i tried.




That was my jpanels.
You will get contentPane first when you open the application. And when you click one of the menus you will get the Jpanel that is for that menu.
If you guys help me to get to make the contantpane invis and make the other visible, it would be great. I couldnt do it (have worked on it 8< hour (i am new to java)).


 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ilo,
Welcome to the Ranch.

Do I understand you correctly, that based on the menu selection, you want to display only specific components and hide the rest?
If yes, then check out card layout
 
Ilo Nato
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maneesh,

I found a cardlayout example on net. It looks like the one have to use. I am gona try it out.

Cheers.
reply
    Bookmark Topic Watch Topic
  • New Topic