This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a JPanel page  RSS feed

 
pankaj saxena
Ranch Hand
Posts: 47
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 3174
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!