-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b34
-
x86
-
linux
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8018969 | 7u45 | Sean Chou | P3 | Closed | Fixed | b01 |
JDK-2230233 | 7u40 | Sean Coffey | P3 | Closed | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode)
and latest java8 code
ADDITIONAL OS VERSION INFORMATION :
Linux zhouyx-workstation 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:50:54 UTC 2012 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
In a gui application including a TextArea, if the TextArea is editable (setEditable(true) ), the application doesn't exit when the frame is disposed.
If the TextArea is not editable (setEditable(false) ), the application will exit when the frame is disposed.
So is TextField .
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On a linux machine, run the testcase.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application exit when the frame dispose.
ACTUAL -
Application does not exit when the frame dispose if TextArea/TextField is editable.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
/*
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Portions Copyright (c) 2012 IBM Corporation
*/
/* @test
* @bug
* @summary editable TextArea blocks gui app from dispose.
* @author Sean Chou
*/
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextArea;
import java.awt.Toolkit;
import java.lang.reflect.Field;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.text.DefaultCaret;
import sun.awt.SunToolkit;
public class TextAreaDisposeBug {
public static volatile boolean passed = false;
public static Frame frame = null;
public static TextArea textArea = null;
public static DefaultCaret caret = null;
public static Class XTextAreaPeerClzz = null;
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("Test");
textArea = new TextArea("editable textArea");
textArea.setEditable(true);
// textArea.setEditable(false);
frame.setLayout(new FlowLayout());
frame.add(textArea);
frame.pack();
frame.setVisible(true);
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame.dispose();
}
});
toolkit.realSync();
}
}
/////////////////////// For TextField
/*
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Portions Copyright (c) 2012 IBM Corporation
*/
/* @test
* @bug
* @summary editable TextField blocks gui app from dispose.
* @author Sean Chou
*/
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextField;
import java.awt.Toolkit;
import java.lang.reflect.Field;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.text.DefaultCaret;
import sun.awt.SunToolkit;
public class TextFieldDisposeBug {
public static volatile boolean passed = false;
public static Frame frame = null;
public static TextField textField = null;
public static DefaultCaret caret = null;
public static Class XTextAreaPeerClzz = null;
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("Test");
textField = new TextField("editable textArea");
// textField.setEditable(true);
textField.setEditable(false);
frame.setLayout(new FlowLayout());
frame.add(textField);
frame.pack();
frame.setVisible(true);
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame.dispose();
}
});
toolkit.realSync();
}
}
---------- END SOURCE ----------
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode)
and latest java8 code
ADDITIONAL OS VERSION INFORMATION :
Linux zhouyx-workstation 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:50:54 UTC 2012 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
In a gui application including a TextArea, if the TextArea is editable (setEditable(true) ), the application doesn't exit when the frame is disposed.
If the TextArea is not editable (setEditable(false) ), the application will exit when the frame is disposed.
So is TextField .
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On a linux machine, run the testcase.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application exit when the frame dispose.
ACTUAL -
Application does not exit when the frame dispose if TextArea/TextField is editable.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
/*
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Portions Copyright (c) 2012 IBM Corporation
*/
/* @test
* @bug
* @summary editable TextArea blocks gui app from dispose.
* @author Sean Chou
*/
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextArea;
import java.awt.Toolkit;
import java.lang.reflect.Field;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.text.DefaultCaret;
import sun.awt.SunToolkit;
public class TextAreaDisposeBug {
public static volatile boolean passed = false;
public static Frame frame = null;
public static TextArea textArea = null;
public static DefaultCaret caret = null;
public static Class XTextAreaPeerClzz = null;
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("Test");
textArea = new TextArea("editable textArea");
textArea.setEditable(true);
// textArea.setEditable(false);
frame.setLayout(new FlowLayout());
frame.add(textArea);
frame.pack();
frame.setVisible(true);
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame.dispose();
}
});
toolkit.realSync();
}
}
/////////////////////// For TextField
/*
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Portions Copyright (c) 2012 IBM Corporation
*/
/* @test
* @bug
* @summary editable TextField blocks gui app from dispose.
* @author Sean Chou
*/
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.TextField;
import java.awt.Toolkit;
import java.lang.reflect.Field;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.text.DefaultCaret;
import sun.awt.SunToolkit;
public class TextFieldDisposeBug {
public static volatile boolean passed = false;
public static Frame frame = null;
public static TextField textField = null;
public static DefaultCaret caret = null;
public static Class XTextAreaPeerClzz = null;
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("Test");
textField = new TextField("editable textArea");
// textField.setEditable(true);
textField.setEditable(false);
frame.setLayout(new FlowLayout());
frame.add(textField);
frame.pack();
frame.setVisible(true);
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame.dispose();
}
});
toolkit.realSync();
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2230233 Editable TextArea/TextField are blocking GUI applications from exit
-
- Closed
-
-
JDK-8018969 Editable TextArea/TextField are blocking GUI applications from exit
-
- Closed
-
- duplicates
-
JDK-6553268 AWT text field prevents Java from auto-shutdown, Linux/Solaris
-
- Closed
-
- relates to
-
JDK-7160623 [macosx] Editable TextArea/TextField are blocking GUI applications from exit
-
- Closed
-