• 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!