ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jones" <kev...@develop.com>
Subject RE: Weird Swing error when using Ant
Date Mon, 10 Sep 2001 06:09:24 GMT
When running a Swing app on JDK1.4b2 (on W2K) the application doesn't end
when you call System.exit()

The app looks like this

public class TestApp extends javax.swing.JFrame
{
    public TestApp ()
    {
        try
        {
            initComponents();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    private void initComponents()
    {
        setTitle("TestApp");
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter()
        {
            public void windowClosing(java.awt.event.WindowEvent evt)
            {
                exitForm(evt);
            }
        });
    }

    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
        System.err.println("exit");
        System.exit(0);
    }

    /**
     * @param args the command line arguments
     */
    public static void main (String args[])
    {
        new TestApp().show();
    }
}

Using Task Manager (on w2k) you see that even after the System.exit() call
there is still one thread executing,

Kevin Jones
Developmentor
www.develop.com




Mime
View raw message