Thursday, January 19, 2012

Close frame programmatically

If we assume we are in a MyJFrame sub-class:

MyJFrame.this.processWindowEvent(
    new WindowEvent(MyJFrame.this,WindowEvent.WINDOW_CLOSED));