Hi i'm doing a GUI project in netbeans. And i have my main Jframe, any one know how i can get another one. Like when I press a button a new Jframe pops
up.
Hi i'm doing a GUI project in netbeans. And i have my main Jframe, any one know how i can get another one. Like when I press a button a new Jframe pops
up.
You can just instantiate any Frame and call the setVisible(true) method of it, just like it is done in the pre-generated main() method of a JFrame:
For making it open when you press a button, double click onto the "actionPerformed" event of the button and Netbeans will make a method (in the frame class) for you that is called when you press the button.PHP Code:
new YourFrame().setVisible(true);
Ok thaks...just one more question. I see when i create a new Jframe its set up whit a main. Is it suppose to?
Depending on what you need it for it sounds like you might benefit from using a JDialog instead of a JFrame.
I'm not sure what you mean by it's set up with a main?
thanks alott for the quick answers
Bookmarks