Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel issue - NetBeans 6.7

 
Kog Susej
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have JFrame and JMenu bar. I want to add a JPanel depending on the menu item selected.

Here JPanel is another container with few components like JTable, Jbutton etc.

So when i select a menu item , The action performed method should instantiate the MYJPanel class and add to the JFrame.

Here is code.




Please advice is there a better way to do this. All I need is when user select a menuitem I want a JPanel to be added to the JFrame and Another Jpanel depending on the menu item selected.


 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!