aspose file tools*
The moose likes Beginning Java and the fly likes How do I use a popup box in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do I use a popup box in Java?" Watch "How do I use a popup box in Java?" New topic

How do I use a popup box in Java?

Thomas Knight
Ranch Hand

Joined: Feb 08, 2003
Posts: 33
I am sure that Java must have something equvilant to VBs input box, where a pop up box appears after some action and there is a textfield where the user can type some text. I looked in the list of Swing components and did not find anything off hand, anybody know? I want to be able to take what the user types in this popup box and use it in my code for processing. Thanks.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Thomas,
Take a look at JOptionPane and JDialog. JOptionPane provides a variety of static methods to create popup dialogs on the fly.
Michael Morris

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
A simple example of what Michael was talking about:

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: How do I use a popup box in Java?
Similar Threads
Any Ideas?
Frameworks to make pages
Force Save
Java rich text editor
how to open JSP page in new window in IBM RAD in portal application