window Destroyer

what does window destroyer do? i removed it from a code but i didn't notice the difference...the reason i removed it was because it said cannot resolve symbol class Window destroyer so i just added "//" to make it a comment and the program seemed to work just fine...

-od

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

publicclass ButtonDemoextends JFrameimplements ActionListener

{

publicstaticfinalint WIDTH= 300;

publicstaticfinalint HEIGHT= 200;

publicstaticvoid main(String[] args)

{

ButtonDemo buttonGui=new ButtonDemo();

buttonGui.setVisible(true);

}

public ButtonDemo()

{

setSize(WIDTH, HEIGHT);

//addWindowListener(new WindowDestroyer());

setTitle("Button Demo");

Container contentPane= getContentPane();

contentPane.setBackground(Color.BLUE);

contentPane.setLayout(new FlowLayout());

JButton stopButton=new JButton("Red");

stopButton.addActionListener(this);

contentPane.add(stopButton);

JButton goButton=new JButton("Green");

goButton.addActionListener(this);

contentPane.add(goButton);

}

publicvoid actionPerformed(ActionEvent e)

{

Container contentPane= getContentPane();

if (e.getActionCommand().equals("Red"))

contentPane.setBackground(Color.RED);

elseif (e.getActionCommand().equals("Green"))

contentPane.setBackground(Color.GREEN);

else

System.out.println("Error in button interface");

}

}

[3028 byte] By [opendoora] at [2007-11-27 8:49:04]
# 1
> what does window destroyer do? http://forum.java.sun.com/thread.jspa?threadID=5188543&tstart=0
Michael_Dunna at 2007-7-12 20:57:33 > top of Java-index,Desktop,Core GUI APIs...