GUI Commands User GuideVersion 2.1 |
||
Close Window CommandThe
The following is a quick example that closes the dialog whenever Escape is pressed: # define the configuration. close-dialog@face.text=_Close@ESCAPE // Create the command JDialog dialog = ...; closeCommand = new CloseWindowCommand("close-dialog", dialog); If you need the frame to be disposed on close you can call
MyFrame frame = ...;
closeCommand = new CloseWindowCommand<MyFrame>("close-frame", frame)
{
@Override
public void handleClose(MyFrame frame)
{
// perform specific close operations here..
frame.doSomethingSpecial();
frame.setVisible(false);
frame.dispose();
}
}
|
||