permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes calling a JPanel page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calling a JPanel page" Watch "calling a JPanel page" New topic
Author

calling a JPanel page

pankaj saxena
Ranch Hand

Joined: Nov 21, 2009
Posts: 46
i have one JFrame that has one JButton and JMenuItem. And another page that extends JPanel.

Question:
Can i call a JPanel page from a click on JButton?
Can i call a JPanel page from a click on JMenuItem?
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
pankaj saxena wrote:
Can i call a JPanel page from a click on JButton?
Can i call a JPanel page from a click on JMenuItem?


What do you mean by "call a JPanel page"? Details mean everything.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

pankaj saxena wrote:And another page that extends JPanel.

Page?

pankaj saxena wrote:
Question:
Can i call a JPanel page from a click on JButton?
Can i call a JPanel page from a click on JMenuItem?


If you meant this to be- making the JPanel visible on the click of a JButton or JMenuItem- You can initially set the JPanel to visible as False. And in the actionPerformed method you can set the visibility to True.

If you can provide details as asked by Pete, it will help you get quicker and correct response


Mohamed Sanaulla | My Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: calling a JPanel page
 
Similar Threads
Calling Classes of JFrame errors
Making two classes work together (newbeginner)
mnemonic
JDesktopPane creates inner frame menuItem actionPerformed does not.
Which JPanel is the button on