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

Creating new JFrame on click of JButton  RSS feed

 
priyas sakorikar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

I am creating a swing applicaiton. I have created a Jframe with a button. when I click on this button it should display data which I retrieved from DB in a different window.
After disposing new window control should come back to main window.
Or is it possible to use anyothe component/container for new window.


Can any one help me?

Thanks..
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a modal JDialog. See the API for JOptionPane and the tutorial on How to Use Dialogs.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!