Link to home
Start Free TrialLog in
Avatar of urivera
urivera

asked on

Opening a second window

In java how do I open up a second window (or pop window) when the user presses a button.  For example, say my main window has a "select city" button, upon pressing the button a second window comes up which lists a list of cities.
Avatar of tbboyett
tbboyett
Flag of United States of America image

make sure that the dialogs are not model and just make the same call again if you want the same window to display again.  
Avatar of mukundha_expert
mukundha_expert

write a class for a frame which lists the cities and in that have a method to initialize the frame and show it. In your main window add a actionlistener to that select cities button, so when ever the button is clicked call the method to show up the second window with list of cities.
ASKER CERTIFIED SOLUTION
Avatar of rongasa
rongasa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mayank S