Community
Participate
Working Groups
I wrote a simple program with GUI. Ever time I run the program and close it, the invoked VM, javaw.exe, still keep alive in the memory. These processes of javaw.exe won't be terminated until the Eclipse is closed. The JDK I installed is jdk1.5.0. The program I wrote as follows: //----------------------------------------------------------------------------- import java.awt.*; import javax.swing.*; import java.awt.event.*; public class MyFrame extends JFrame implements ActionListener{ private JButton button; private JLabel label; private String name[]={"A","B","C","D"}; private int idx; public MyFrame(){ super("Test it!"); idx=0; Container c=getContentPane(); c.setLayout(new FlowLayout(FlowLayout.CENTER)); label=new JLabel(name[idx]); button=new JButton("push me!"); label.setToolTipText("I am tips!"); c.add(label); c.add(button); setSize(800,600); setVisible(true); button.addActionListener(this); } public static void main(String args[]){ MyFrame app=new MyFrame(); } public void actionPerformed(ActionEvent e) { if(idx==3) idx=0; else idx++; label.setText(name[idx]); repaint(); } } //----------------------------------------------------------------------------- These processes of javaw.exe do slow down my computer a lot because they consume too much memory.
This has nothing to do with Eclipse. You have the UI thread that is running and therefore the program won't exit as long as it is running. You would have the same problem running from the command line. You need to exit when the frame is closed. Close as INVALID.