When the size of the window changes, it does not trigger WindowStateChangeD but triggers the ComponentAdapter.
Import java.awt. *;
Import java.awt.event. *;
Import javax.swing. *;
Public class myframe extends jframe {
Class MCA EXTENDS Componentadapter {
Public Void ComponentResized (ComponEntevent E) {
System.out.println ("ComponentResized");
}
}
Class Mwa EXTENDS WINDOWADAPTER {
Public void windowClosing (WindowEvent E) {
System.exit (0);
}
Public void windowStateChanged (WindowEvent E) {
System.out.println ("WindowStateChanged");
}
}
Public myframe () {
Super ("Test");
AddWindowListener (New MWA ());
AddcomponentListener (New MCA ());
Setsize (200, 100);
SetVisible (TRUE);
}
Public static void main (String [] args) {
Myframe mf = new myframe ();
}
}
I have been in the old half a day, really depressed.