| Author |
How to make a popup Window, not Menu
|
Bigglesworth Naruki
Greenhorn
Joined: Nov 05, 2001
Posts: 14
|
|
I want to put a button on my panel that, when pressed, will generate a new modal window that I can customize just like a regular application JFrame. I've looked at the Java Sun tutorials and the API docs, but for some reason I am just not seeing how to do this. The only other requirement is that I can retrieve/set the values on the popup window's components even when it's not visible. Surely this is simple, right?
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
The class you're looking for is JDialog. You can lay out components on a JDialog just like a JFrame. You can also access the values of fields on your JDialog if you create it in your current class, or if you create it in another class and add methods to return the values. To make it launch on a button click, all you have to do is create the dialog beforehand, then add an actionListener to the button that makes the JDialog visible. -Nate
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
 |
|
|
subject: How to make a popup Window, not Menu
|
|
|