WindowDestroyer can not pass compile

I am new to Java Graphic, Here is my code, very simple one.

import javax.swing.*;

public class SwingDemo

{

public static void main(String[] argus)

{

JFrame myWindow = new JFrame();

myWindow.setSize(300,200);

JLabel myLabel = new JLabel("hi flyingtide");

myWindow.getContentPane().add(myLabel);

myWindow.setVisible(true);

WindowDestroyer myListener = new WindowDestroyer();

myWindow.addWindowListener(myListener);

myWindow.setVisible(true);

}

}

But when compile,the error msg always point to --> WindowDestroyerand say"can not resolve sumbol" .

What hava I did wrong?

Thanks.

[697 byte] By [puputaoa] at [2007-10-1 6:43:50]
# 1

Hello,

the class "WindowDestroyer" does not exist!

To close the window try:

myWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

or

myWindow.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {

System.exit(0);

}

});

Regards,

Xarena

Xarenaa at 2007-7-9 16:48:33 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 2
Thank you!!! Sorted. ^_^
puputaoa at 2007-7-9 16:48:33 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...