wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Invisible Jpanels with jmenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Invisible Jpanels with jmenu" Watch "Invisible Jpanels with jmenu" New topic
Author

Invisible Jpanels with jmenu

Ilo Nato
Greenhorn

Joined: Oct 16, 2009
Posts: 6
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

Joined: Jul 26, 2007
Posts: 10270
    
    8

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


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ilo Nato
Greenhorn

Joined: Oct 16, 2009
Posts: 6
Thanks Maneesh,

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

Cheers.
 
 
subject: Invisible Jpanels with jmenu