save window size and location on dispose

cusax-fix
Yana Stamcheva 20 years ago
parent fa4d40e250
commit 5404a5661e

@ -182,16 +182,27 @@ public void setVisible(boolean isVisible)
if(isVisible) {
this.pack();
this.setSizeAndLocation();
JButton button = this.getRootPane().getDefaultButton();
if(button != null)
button.requestFocus();
}
JButton button = this.getRootPane().getDefaultButton();
if(button != null)
button.requestFocus();
super.setVisible(isVisible);
}
/**
* Overwrites the dispose method in order to save the size and the position
* of this window before closing it.
*/
public void dispose()
{
super.dispose();
this.saveSizeAndLocation();
}
/**
* All functions implemented in this method will be invoked when user
* presses the Escape key.

@ -175,6 +175,17 @@ public void setVisible(boolean isVisible)
super.setVisible(isVisible);
}
/**
* Overwrites the dispose method in order to save the size and the position
* of this window before closing it.
*/
public void dispose()
{
super.dispose();
this.saveSizeAndLocation();
}
/**
* All functions implemented in this method will be invoked when user
* presses the Escape key.

Loading…
Cancel
Save