Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I do form.show

 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I wonder if anyone could give me some ideas about how to click an button and pop up a new window just like form.show in vb?
Thanks in advance.
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know any VB, so I may be missing the point of your question.
Create a button, assign an ActionListener to the button. In the actionPerformed method of the ActionListener, create a new JFrame or JDialog.
I do something like this when the user books a flight. After they select a flight I pop up a JDialog that prompts them to select from a JList the number of seats they want to book.
 
Robin Underwood
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JOptionPane is like a simple popup window. JDialog would be used for a more complicated popup window.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic