Close 1 « JFrame « Java Swing Q&A





1. Why does my application still run after closing main window?    stackoverflow.com

If I make a JFrame like this

public static void main(String[] args) {

     new JFrame().setVisible(true);
}
then after closing the window the appication doesn't stop (I need to kill it). What ...

2. How to programmatically close a JFrame    stackoverflow.com

What's the correct way to get a JFrame to close, the same as if the user had hit the [x] button, or pressed Alt+F4 (on windows)? I have my default close operation ...

3. how do i close a frame yet open a new frame?    stackoverflow.com

how do i close a frame yet open a new frame? i have a frame, (help) when i click on my menu item i want to open (mainForm) exit from help. new mainForm().setVisible(true); System.exit(0); i know ...

4. java swing, i want to close one JFrame without closing another, how can i get it?    stackoverflow.com

i have three JFrames, i want to close one of them without influence to another. what can i do to get it ? thanks Peter. I want to open two(or more) JFrames at ...

5. JFrame close question    stackoverflow.com

Say If i have two classes, in each class is a different JFrame, e.g JFrame A and JFrame B ( in seperate classes). Now from the constructor of JFrame A I may ...

6. Why when i am closing a JFrame window that was launched from an Eclipse plugin the whole Eclipse framework stops also?    stackoverflow.com

I have created an Eclipse plugin that adds a button at the menu bar and when you click the button a new Java GUI applications is starting(the application was implemented with ...

7. adding behavior when closing a JFrame    stackoverflow.com

I have created a JFrame and I would like to associate a specific behaviour when this JFrame is closed. Is it possible?

8. swing: programmatic close of JFrame    stackoverflow.com

What's the programmatic equivalent of clicking the close (x) button in the upper right corner of a JFrame? There's the dispose() method but that's not the same thing, since a ...

9. How can I launch a new window (a copy of itself) then closing each independently? In java    stackoverflow.com

I want for my program to be able to launch another copy of itself, this

new Thread(){
     public void run() {
        ...





10. How to close current window in jframe?    stackoverflow.com

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import javax.swing.JFrame;

import class_program.NextPage;

class Login extends JFrame implements ActionListener
{
 JButton SUBMIT;
 JPanel panel;
 JLabel label1,label2;
 final JTextField  text1,text2;
  Login()
  {
    label1 = new ...

11. How to close a jframe without closing the main program    stackoverflow.com

IM creating a program to keep track of a list of dvd's. On the main page i have set up 2 jbuttons. when user clicks the one that says new a ...

12. How to close JFrame followed by another JFrame?    stackoverflow.com

I have a JFrame panel. It opens several times. However, I want the previous one to close, right before the new one opens. So is there a way to add some ...

13. Java: How do I close a JFrame while opening another one?    stackoverflow.com

My program starts with a picture with a textfield in a JFrame. I want when the user types start it closes the picture JFrame and opens another JFrame with the main ...

14. Close current window from code behind    stackoverflow.com

I know I can close an application using System.exit(0); but I want to close just the current window, not the whole application. How can I close just the current window from ...

15. Window Close in Swing Application Problem    stackoverflow.com

i have build a swing application and there are 3 frames frame-1 contains button that open frame-2 and frame3. ...

16. How can I configure a Swing JFrame to close on Cmd-W?    stackoverflow.com

On OS X, users expect to be able to press Cmd-W to close a window. Can I configure a JFrame to do this?





17. Application exits on closing of Jframe in java swing in netbeans 7.0    stackoverflow.com

i am actually developing GUI application whwn i run this application a login window comes i have a button on it when after successful login i have MDI application form i ...

18. Closing JFrame on Mouse Click    stackoverflow.com

Hey guys, I want my JFrame to close on a mouse click. I have code to do it, but it isn't working...

public void closeFrame ()
{

    jPanel.removeAll ();
  ...

19. stopping a jTimer on frame close    stackoverflow.com

I have a frame which starts a swingTimer to perform a periodic task. The problem is when I close the frame, the task still continues. I want the swingTimer to stop ...

20. Need to close a parent window only if the child window get closed in java swing    stackoverflow.com

I have two radio buttons in frame1. On click on enable radio button, it will popup another frame called frame2. I want, not to close the frame1 while the frame2 is ...

21. Java - how do I prevent WindowClosing from actually closing the window    stackoverflow.com

I seem to have the reverse problem to most people. I have the following pretty standard code to see if the user wants to do some saves before closing the ...

22. Close one Frame (not the whole application) using AWT    stackoverflow.com

On click, How to close only one Frame not both or whole application? (I have also tried with AWT Event dispatch, EDT)

package test;

import java.awt.*;
import java.awt.AWTEvent;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.event.*;
import java.lang.reflect.InvocationTargetException;

public class Test11 ...

23. How to detect the JFrame is closed?    stackoverflow.com

I tried a addWindowListener and implement the windowClosing, it works, when I press the close button, but when I use Cmd+Q to close, the windowClosing is not being called, how can ...

24. how can i modify the close operation for a GUI JFrame?    bytes.com

hello, i currently have a driver program which connects my application to a local database. I was wondering how i can monitor the default close operation such that when the user ...

25. override closing function of a swing form    forums.netbeans.org

26. close jframe    forums.netbeans.org

in my project i have two jrame named first and second. when i click a button in first jrame then second jrame will open. there is a ok button in second ...

27. Open/Close JFrame    forums.netbeans.org

The thing is I want to close the first form that opens after passing a validation procedure of my own, and show the Main form (you see above) next. How can I do this? Thanks in advance.

28. Application exits on Jframe being closed!!    forums.netbeans.org

[img]http://imagebin.org/140858[/img] From the above image, I am calling various objects of different classes from the homepage.java class. All these classes like deleteloanhp_new.java are actually jframes. When I click the close button on these jframes, the entire application quits instead of just closing the window. I tried setting defaultcloseoperation of the jframe in deleteloanhp_new.java as HIDE but still the entire application quits ...

29. [HELP]GUI window closing    forums.netbeans.org

Hello guys, This is my first time using netBeans forums so don't kill me if I do anything wrond So let's go straight to my problem : I'm making an application using the GUI editor (jFrame). I want to make a button that closes the window after clicking it, but I don't want to use System.exit();, I want the window to ...

30. Window closing    coderanch.com

Hi! I think the problem is in the close operation property set for the frame. Is it Hide or Dispose?If Hide it should work because you do not really close the frame but make it hidden. If dispose, you force the frame to DIE so it can't be available after the closing event. If you have just choosen Hide it may ...

31. How to Close Frame    coderanch.com

33. closing a frame    coderanch.com

Hi: I have a ParentFrame with some buttons. One of the buttons, creates and brings up ChildForm. Now how do I close the ChildForm, without using a System.exit(1). I was thinking of the dispose method, but the more I think(?) the more confused I am. Could someone give me a conceptual idea....okay I can provide a close button on the ChildForm. ...

34. closing a frame    coderanch.com

35. JFrame close property    coderanch.com

36. close frames    coderanch.com

37. JFrame window closing    coderanch.com

38. Stop JFrames/JDesktopPanes from closing    coderanch.com

39. How to just close One window?    coderanch.com

40. Window Close Conformation    coderanch.com

41. close JFrame    coderanch.com

42. No 'close' in a JFrame    coderanch.com

43. Closing a frame from another frame    coderanch.com

Here every time you are creating a new instance of ColorPicker in the toggleColorPicker() method, and when you are expecting to close the frame, you are closing the newly created Frame. You should declare colWin as a class level variable (member of the class), rather than a local variable in the toggleColorPicker() method. public Class { .... .... ColorPicker colWin=null; .... ...

44. Closing a frame    coderanch.com

Hi everyone, I'm creating a frame on the fly from another frame. I need to close it on hitting the submit button. At all other times till the submit button id displayed and hit, it has to remain open. So I have mentioned : setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); i'm not able to change this option in the actionperformed methos for the submit button. The ...

45. suspending frame from closing    coderanch.com

my windowClosing(event) method overrides windowClosing(event). when the user clicks "x" in the main frame (frame), i would like the frame to stay open until the user clicks "yes" or "no." as of now, the frame closes, then the "yes/no" option frame pops up. class windowClosing extends WindowAdapter { public void windowClosing(WindowEvent e) { if(e.getWindow() == exitFrame) { exitFrame.dispose(); frame.setEnabled(true); }//end if ...

46. Closing a JFrame once the data is submitted    coderanch.com

You just need to call dispose() of the frame you need to close. Without seeing the code for InsertDefect it's hard to say where you might want to do this. But I would assume, if InsertDefect has access to the Frame object, you should just be able to do frame.dispose() after you return the 1.

47. Closing a JFrame without using WindowEvent    coderanch.com

Hi, I am just wondering if we can close a frame without using addWindowListener. I just want the frame to be closed without clicking on the X mark of the frame. I tried setVisible(false) but it just makes the frame invisible but it's still running, I want the application to be closed. If there is a way or any suggestions please ...

48. Close one Frame open another?    coderanch.com

49. How to close a window and open another one    coderanch.com

Something like this perhaps import java.awt.*; import java.awt.event.*; import javax.swing.*; class OpeningWindow extends JFrame implements ActionListener { JButton btn = new JButton("Continue"); public OpeningWindow() { setTitle("Opening Window"); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setLocation(200,100); setSize(200,100); Container frame = getContentPane(); JPanel jp = new JPanel(); btn.addActionListener(this); JLabel lbl = new JLabel("I am the opening window"); jp.add(lbl,BorderLayout.NORTH); jp.add(btn,BorderLayout.SOUTH); frame.add(jp); } public void actionPerformed(ActionEvent ae) { new MainWindow().setVisible(true); this.dispose(); ...

50. abnormal window closing!!!    coderanch.com

i am working on an data upload-download utility made in java.at start it offers a window with three buttons:upload,download,cancel and a textarea.as we press the buttons,respective actions are taken.when i transfer data(about 1000 rows) from MS Access to MS Access,the program works fine and after transfer is completed the window still exists.but when i transfer the same data from Oracle to ...

51. frame close operations (GUI)    coderanch.com

class Explore { public Explore() { JButton one = new JButton("one"); JButton two = new JButton("two"); ActionListener l = new ActionListener() { public void actionPerformed(ActionEvent e) { JButton button = (JButton)e.getSource(); } }; one.addActionListener(l); // use the reference "l" to two.addActionListener(l); // to refer to the listener JRadioButton[] buttons = new JRadioButton[4]; RadioListener rl = new RadioListener(); // rl is the ...

52. Closing an inner frame    coderanch.com

53. Closing a JFrame    coderanch.com

54. Closing a frame    coderanch.com

I am trying to have the program close the first frame when i open the second one, what i have tried does not work. //Created by Mark on Wednesday 2 June 2004 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SplashScreen extends Frame implements ActionListener { static int hpos=50, vpos=500, bhpos=10, bvpos=200,badhpos=100; static String dudepic; static boolean SecondWindowOpen=false; private Font font ...

55. Closing a window.    coderanch.com

56. Closing Parent Window    coderanch.com

57. SWT: How to prevent window from closing when clicking "X"?    coderanch.com

Hi! Basically, I want to implement the following functionality: When the user wants to close the window by clicking X button, I wish to popup a message saying "do you wish to save your crap, YES | NO | CANCEL". I did this by adding a disposeListener on the shell... Now I am trying to figure out how to prevent disposal ...

58. closing a current jframe    coderanch.com

59. Close currently opening JFrames which are opend in JInetrnalFrame    coderanch.com

Hi Swati Once I used System.exit() then close the main menu also. I need to close only the internal frame and the opened Jframes only. To selectively close the required windows, how I can identify what are the opened jframes objects. Since there are several menues in the Main menu. and user can open only one internalfame at a time. There ...

60. Memory leak by "closing" JFrame?    coderanch.com

Suppose my GUI application opens a second JFrame (perhaps allowing the user to edit data) and then closes that frame, although the application itself keeps running. Now, I can "close" that second frame by setting visible to false. But if that's all I do, isn't this a memory leak? It seems to me that I should create a reference to that ...

61. close window when new one opens    coderanch.com

I've made a menu screen that has a series of buttons that, when clicked on, open up a new window. I want the menu screen to close when a button is clicked and the new window pops up but I can't figure out how to get it to work. Its not a big deal, just a little nuisance thats drivin' me ...

62. closing a JFrame    coderanch.com

got a quick question. I have a MainFrame which opens my ui. Then i have a couple buttons which open smaller frames. Here lies the problem, or lack of knowledge on my part. I cant figure out how to close the smaller opened frames, without closing the entire application itself. What i want is to have a button on one of ...

63. Closing a JFrame    coderanch.com

64. Closing a JFrame    coderanch.com

Thanks Nick This works and the frame disappears. Does it really free all the resources of the frame? I ask because when I clicked for the frame to be recreated, it appeared in the same place on the screen as it had been when I clicked for it to be closed. (or maybe this was within the memory of the object??) ...

66. Frame not closing when parent is closed    coderanch.com

Hello all, I have a quick question, I have added a frame to my application that opens when you click on a certain button, but when the parent frame is closed the frame I created remains open. How can I make sure, that when the user closes the parent frame(the application) my frame also disposes? Thanks a lot in advance, I ...

67. Problem in Closing the window    coderanch.com

Dear friends, Whenever i use Exit option from File Menu my application will prompt the user to save the file. Whene i use ALT-F4 option also its doing the same. But when i use the close button at the top right corner of the window and when i right click the application from the desktop taskbar and click Close, the application ...

68. How to deactivate close, minimise and resizable from a window say frame?    coderanch.com

> Sorry friend, but the said method didnt worked... The title bar still shows > all the three.. then you've done something totally wrong - setUndecorated(true) removes the title bar entirely. anyway, if you want to use JFrame.setDefaultLookAndFeelDecorated(true); you can then recursively iterate the frame's components, looking for the buttons and remove them.

69. floating JToolBar doesn't close    coderanch.com

Dispose will only get rid of the object you have closed; it doesn't shut down the JVM and obviously doesn't get rid of a floating toolbar. Is it safe to use EXIT_ON_CLOSE? Or do you need to go through a file-saving method before closing? Try that. BTW: Dispose is the default, so you don't need to specify it.

70. Close JFrame    coderanch.com

Hi, I have a JFrame that have a file menu that contains Exit. I also have a method in my GUI called closeApplication(); I have a hook on the file/exit menu, when the user click on exit I can execute my closeApplication() method. I want the same behavior for the x on the upper right corner... The only thing I have ...

71. Window Closing Problem    coderanch.com

import java.awt.*; import java.awt.event.*; class Box extends Frame { private Frame fMain; public Box(Auditoire auditoire){ fMain = new Frame("Test"); fMain.setSize(250,150); Label info = new Label("Informations sur l'auditoire"); info.setAlignment(Label.CENTER); info.setForeground(Color.WHITE); info.setBackground(Color.BLACK); Button bAvrg = new Button("Calculer la moyenne"); Button bPass = new Button("No# d'etudiant reussi"); Panel p = new Panel(new FlowLayout()); TextField tf = new TextField("10"); p.add(new Label("Points:")); p.add(tf); fMain.setLayout(new GridLayout(4,1)); fMain.add(info); ...

72. frame close    coderanch.com

73. jFrame Closing Solution    coderanch.com

74. Why are my JFrames closing?    coderanch.com

Hi All I'm trying to create my own instant messenger and have come across a problem. I have a log in form, when the user enters their name. Once they click 'Log In', another window opens displaying the users that are currently online. My problem arises when I want to close the log in form. When I close this the other ...

75. Closing my application (frame)    coderanch.com

The DefaultCloseOperation option is perfectly fine for simple straight forward "hey close my program now" usage. WindowListeners are useful for more specific actions when closing a window. Say for instance you want the user to verify his close decision prior to actually exiting the program or if you want to do something like a forced save of data immediately prior to ...

76. How to close this window?    coderanch.com

i just dont know how to code this very simple situation: i have this first window that has a button which when clicked opens a second window; this second window has a button that when clicked should close just this window, not the app can anyone please help me? thanks in advance the working code follows import javax.swing.*; public class OpenWindow ...

77. Close Parent Window When Child Window Closes    coderanch.com

First off, I dont mean I want the program to end. What I have setup is a simple game that shows pop-up windows that are either Info or Input windows and I would like to know how to close a child's window when it's child window closes. So far its like this: Main Input Window launches Attack Input Window which launches ...

78. Closing JFrame    coderanch.com

79. Prompting the user whether to close the JFrame    coderanch.com

I would like to know how to add an event that prompts the user whether I can add an event handler for asking the user to confirm whether the program will exit when they select the [x] icon. import javax.swing.*; import javax.swing.filechooser.*; import java.awt.*; /** * @version 0.1 * @author Jon C. */ public class ChooserTest { public static void main ...

80. Getting an InterruptedException after closing Frame    coderanch.com

import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Temp { public static void main(String... args) { EventQueue.invokeLater(new Runnable() { public void run() { TempFr t1=new TempFr(); t1.setVisible(true); t1.setDefaultCloseOperation(t1.EXIT_ON_CLOSE); } }); } } class TempFr extends JFrame { private JFileChooser jfc1; TempFr() { setSize(600,700); setTitle("Wassup again"); JFileChooser jfc1=new JFileChooser(); JMenuBar jmb1=new JMenuBar(); setJMenuBar(jmb1); JMenu file=new JMenu("file"); jmb1.add(file); JMenuItem open=new JMenuItem("open",'o'); JMenuItem close=new ...

81. close and open a frame    coderanch.com

Hello friends, thank you very much for your quick replies and helped me a lot to solve my previous problem. This time i have a different question. How do i make a frame to be hidden and open another one when a button is clicked.. I have written this code in the actionperformed event of one button in frame1 frame1.show(false); frame2.show(); ...

83. Closing a JFrame    java-forums.org

Hi there, Ive created a program thats essentially a address book GUI. In this i have a function that allows u to add a contact. When this is clicked it creates a new JFrame my question is what code can i use to create a JButton that will just exit that JFrame and not close the program. cheers simon

84. Can't close JFrame    java-forums.org

import java.awt.*; import javax.swing.*; import javax.imageio.*; import java.awt.Graphics.*; import java.io.*; import java.awt.image.*; import java.awt.Component.*; import java.*; import javax.*; import java.awt.event.*; public class StatxMenu extends JPanel{ BufferedImage Back = ImageIO.read(new File ("StatMenu.png")); BufferedImage Skills = ImageIO.read(new File ("Skills.png")); BufferedImage System = ImageIO.read(new File ("System.png")); Dimension dim = new Dimension(Back.getWidth(), Back.getHeight()); boolean bSkills = false, bSystem = false; public StatxMenu() throws IOException{ setPreferredSize(dim); ...

85. dont close a jFrame    java-forums.org

private void initialize() { this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); this.setJMenuBar(getJJMenuBar()); this.setContentPane(getJContentPane()); this.setTitle("Mdulo Administrativo"); this.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.out.println("windowClosing()"); // TODO Auto-generated Event stub windowClosing() CerrarConfirmacion(e); } }); this.setLocationRelativeTo(null); this.setExtendedState(MAXIMIZED_BOTH); } public void CerrarConfirmacion(WindowEvent e){ int respuesta = JOptionPane.showConfirmDialog(null, "Est seguro que desea salir de la aplicacin?", "Saliendo....", JOptionPane.YES_NO_OPTION); if (respuesta == JOptionPane.YES_OPTION) { System.exit(0); } }

86. closing JFrame without terminating program    java-forums.org

There are two frames and when you click on a button on the first frame it opens the second frame. On the second frame I'm trying to create a button which when pressed closes the JFrame without terminating the program but I'm having no luck. This is the code that I'm trying to use for the second frame, which without the ...

87. Close a JFrame, but keep the original open.    java-forums.org

I have a JFrame called FinancialGUI. It has a button that, when clicked, creates a new JFrame called EditPayPeriodGUI. When I exit EditPayPeriodGUI, the entire application closes, but I only want the EditPayPeriodGUI to close. I do have setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) which I'm sure I shouldn't have. But what else do I need to put? *SOLVED* Instead of using JFrame.EXIT_ON_CLOSE, I used JFrame.DISPOSE_ON_CLOSE ...

88. frame closing    java-forums.org

import java.awt.*; import java.awt.event.*; class EventDemo implements ActionListener { Frame f; Button b, b1; TextField tf; EventDemo(String s) { f=new Frame(s); b=new Button("OK"); b1=new Button("CANCEL"); b.setBounds(20,100,50,50); b1.setBounds(20,180,50,50); b.addActionListener(this); b1.addActionListener(this); f.add(b); f.add(b1); tf=new TextField(); tf.setBounds(20,40,100,40); tf.addKeyListener(new KeyEventListener()); f.add(tf); f.addWindowListener(new WindowEventListener()); f.addMouseListener(new MouseEventListener(this)); f.setLayout(null); f.setSize(400,400); f.setVisible(true); } public void actionPerformed(ActionEvent e) { if(e.getSource()==b) tf.setText("OK"); if(e.getSource()==b1) tf.setText("CANCEL"); } public static void main(String s[]) { ...

89. Closing Child Frame    java-forums.org

Hi everyone! I'm new in Java and I have some trouble in closing child frame: I've got a main JFame and JPanel. From JFrame I'm creating another frame (lets say frame1 ) and object of JPanel ( panel1 ). Further panel1 is added to frame1. When user clicks on button in main frame frame1 opens. On Jpanel I've got a EXIT ...

90. JFrame Conditional Close    java-forums.org

import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JOptionPane; // Displaying a JFrame at the center of the screen using Java Toolkit Class public class jFrameDemo extends JFrame { jFrameDemo() { setTitle("Center a Frame on Screen"); // jframe title setSize(400, 300); // jframe size this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); addWindowListener(new WindowAdapter() { // java jframe close public void windowClosing(WindowEvent e) { if (JOptionPane.showConfirmDialog(null, "Are you sure ...

91. How to close an open JFrame window from a jsp page?    java-forums.org

How to close an open JFrame window from a jsp page? I have used the class file to create a JFrame and by importing that class file into my jsp page, and by calling a method in that class, I have enabled a JFrame window as a pop up. Now when I try to logout from that jsp page, all the ...

93. JFrame always closes despite of option chosen    java-forums.org

I'm trying to write a window handler but for some reason, my JFrame always closes when user clicks the 'X' button, even if the user clicks 'No' or 'Cancel' in the confirmation box. Can anyone check the code for me please? private class WindowHandler implements WindowListener { public void windowClosing(WindowEvent arg0) { if (JOptionPane.showConfirmDialog(null, "Are You Sure?", "Quitting", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == ...

94. How do I stop my swing frame from closing when I print?    forums.oracle.com

My frame has default close settings. When I invoke the print service and the little popup to print comes up, if I cancel it my swing frame is closed..... I'm still a gigantic novice, what close settings should I use and if it's nothing to do with that how do I stop the stupid thing from closing my frame? Thankyou very ...

95. A close-up JFrame of another.    forums.oracle.com

Hi all. Is it possible to have a JFrame that takes the properties of another and enlarge it? I have done some research, and I noticed that it is possible with a JSpinner class, but I was wondering if there was an easier way of doing it without the JSpinner class. Any replies would be very helpful. thank you.

96. Execute instructions when JFrame is closing    forums.oracle.com

97. JFrame.HIDE_ON_CLOSE hides, but wont show again    forums.oracle.com

I have set the main frame of my application to HIDE_ON_CLOSE, and when I click the "x" on the frame, it closes, but then when I try to call the frame again to make it reappear using: myApp.getApplication().getMainFrame().setVisible(true); Only the frame appears, the contentPanel (the child of the frame) does not appear. Any ideas why it won't display? Also, to give ...

98. Leaving LosVegas (CLOSE JFRAME)    forums.oracle.com

99. How to wait for a JFrame to close.    forums.oracle.com

I've created a JFrame and set it to visible, but i need to hold my main() until it finishes. I'm using while(EEMain.isVisible()); as a place holder right now, but it just uses up cpu cycles needlessly, i tried while(EEMain.isVisible()) { try { wait(100); } catch etc..... to make it a little less cpu intensive, but main() is static and wait() isn't. ...

100. how to close a jframe from within the code    forums.oracle.com