1

I am making a GUI in netbeans. I have a button and when users clicks it i want to popup a jframe. How is this possible? could someone give me an example?

Rory Lester
  • 2,858
  • 11
  • 49
  • 66
  • 3
    Don't have a JFrame "pop-up" another JFrame. The second window should be a JDialog. The best way to learn how to do this is to go to the Swing tutorials and read up all you can as well as by making the Java API your best buddy. Then write lots and lots of code. – Hovercraft Full Of Eels Feb 26 '12 at 22:20
  • 1
    For an example of creating and showing a JDialog, please see my code in [this stackoverflow answer](http://stackoverflow.com/a/8524302/522444) or for a variation, please check out [this answer](http://stackoverflow.com/a/7017147/522444). – Hovercraft Full Of Eels Feb 26 '12 at 22:29
  • @Michael Tanasa use JDialog / JWindow – mKorbel Feb 26 '12 at 22:33
  • Thanks guys, used JDialog and it worked out great. – Rory Lester Feb 26 '12 at 22:46

1 Answers1

1

Are you programming a NetBeans RCP application? If so then take a look to the Dialogs API: http://bits.netbeans.org/dev/javadoc/org-openide-dialogs/index.html?org/openide/NotifyDescriptor.html If not, give a try NetBeans RCP can improve the code quality and modularity of your java desktop applications.

acanimal
  • 4,800
  • 3
  • 32
  • 41