diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java index 63e6b47fa..0dc124c6f 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommDialog.java @@ -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. diff --git a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommFrame.java b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommFrame.java index 03e8f7268..b3d2510ca 100644 --- a/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommFrame.java +++ b/src/net/java/sip/communicator/impl/gui/customcontrols/SIPCommFrame.java @@ -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.