bug fix for when disposing window

This commit is contained in:
fros4943 2007-03-22 09:34:50 +00:00
parent 67f08c398e
commit e4372605fb

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ContikiMoteTypeDialog.java,v 1.15 2007/01/10 08:48:13 fros4943 Exp $
* $Id: ContikiMoteTypeDialog.java,v 1.16 2007/03/22 09:34:50 fros4943 Exp $
*/
package se.sics.cooja.contikimote;
@ -126,7 +126,8 @@ public class ContikiMoteTypeDialog extends JDialog {
final ContikiMoteTypeDialog myDialog = new ContikiMoteTypeDialog(
parentFrame);
myDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
myDialog.myMoteType = moteTypeToConfigure;
myDialog.myGUI = simulation.getGUI();
myDialog.allOtherTypes = simulation.getMoteTypes();
@ -807,6 +808,31 @@ public class ContikiMoteTypeDialog extends JDialog {
contentPane.add(mainScrollPane, BorderLayout.CENTER);
contentPane.add(buttonPane, BorderLayout.SOUTH);
addWindowListener(new WindowListener() {
public void windowDeactivated(WindowEvent e) {
}
public void windowIconified(WindowEvent e) {
}
public void windowDeiconified(WindowEvent e) {
}
public void windowOpened(WindowEvent e) {
}
public void windowClosed(WindowEvent e) {
}
public void windowActivated(WindowEvent e) {
}
public void windowClosing(WindowEvent e) {
myMoteType = null;
dispose();
}
});
// pack();
}