Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I use a popup box in Java?

 
Thomas Knight
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple example of what Michael was talking about:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic