I tried to do this in Java:
public class Fram extends JFrame{
public void init(){
addWindowStateListener(new java.awt.event.WindowStateListener() {
public void windowStateChanged(java.awt.event.WindowEvent evt) {
wsc(evt);
}
});
}
private void wsc(java.awt.event.WindowEvent evt) {
System.out.println(evt.getNewState() == Frame.MAXIMIZED_BOTH);
System.out.println(this.getWidth());
}
}
And the output is late.
When I maximize it the value is 360, but actual value is 1260. How do I the get width after maximizing?