File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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]
Don't get me started about those stupid light bulbs.
subject: How do I use a popup box in Java?
Similar Threads
Java rich text editor
Frameworks to make pages
Any Ideas?
how to open JSP page in new window in IBM RAD in portal application
Force Save