• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

badly stuck with GUI problem

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am makin the GUi which has the main frame and container inside the
public class...now i have an inner class which opens another
frame as a popup.... now when i try to close the popup then the entire
application closes.

heres the code for the popup class...

JPanel panel = new JPanel();


JFrame frame = new JFrame( "Graphs" );

frame.setSize(200,200);
frame.getContentPane().add( panel );
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);

//Make sure we have nice window decorations.
frame.setDefaultLookAndFeelDecorated(true);

//Display the window.
frame.pack();
frame.setVisible(true);


please advice
 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using a different close operation for the frame, like DISPOSE_ON_CLOSE or HIDE_ON_CLOSE.

How does that work for you?
Cheers,
rachel
 
We noticed he had no friends. So we gave him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic