0

a eclipse program by java language have several JFrame's and some JFrame's are called any JFrame's or Class's as Thread. problem are when one of JFrame's need to close then all of JFrame's closed and thread's will be started as that JFrame incomplete closed. one offer is use f.setVisible(false); but this is not good because in through time i have many JFrame's because JFrame's are called as:

JFrame f = new JFrame();//make new JFrame
f.setVisible(true);
Frakcool
  • 10,915
  • 9
  • 50
  • 89
  • See [The use of multiple JFrames, Good / Bad Practice?](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-or-bad-practice). And for better help sooner please post a [mcve] – Frakcool Jun 15 '16 at 19:58
  • Also check: [JFrame#dispose()](https://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#dispose%28%29) and [JFrame#DISPOSE_ON_CLOSE](https://docs.oracle.com/javase/7/docs/api/javax/swing/WindowConstants.html#DISPOSE_ON_CLOSE) – Frakcool Jun 15 '16 at 20:00
  • 1
    Set the default close behavior. https://www.clear.rice.edu/comp310/JavaResources/frame_close.html – Compass Jun 15 '16 at 20:01

0 Answers0