Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pop up window help

 
cassie williams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
how do i have a pop up window(JFrame or some sort) upon clicking on a jbutton?
thanks
 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cassie,
I usually create a class which extends a JFrame and contains everything I want for my popup window. Then add an actionListener to the button you want to open the form. On the button being clicked I create an instance of my popup window form, call the method to make it do something and then call myform.show().
there are probably better ways but it works
[ April 12, 2004: Message edited by: Amy Phillips ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic