Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invisible Jpanels with jmenu

 
Ilo Nato
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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)).


 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic