JDK-7146572 : enableInputMethod(false) does not work in the TextArea and TextField on the linux platform
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-02-17
  • Updated: 2014-10-15
  • Resolved: 2012-03-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b29Fixed
Related Reports
Relates :  
Relates :  
Description
Reported at: http://mail.openjdk.java.net/pipermail/awt-dev/2012-February/002240.html

Given a simple test case below[1], enableInputMethod(false) does not work. We can always invoke input method.
[1]
public class MyAWTTest extends JFrame {
    Component c;

    public MyAWTTest() {
    super("Single Frame --- AWT Frame");

    setLayout(new FlowLayout());

    c = new TextArea("TextArea component(No IM)");
    c.enableInputMethods(false);
    c.setPreferredSize(new Dimension(400, 100));
    add(c);

    c = new TextField("TextField component(No IM)", 52);
    c.enableInputMethods(false);
    add(c);

    setSize(850, 360);
    setVisible(true);

    setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
        new MyAWTTest();
        }
    });

    }
}

Comments
noreg-hard: note, there's already noreg-other. An above [SQE] comments mentions the recommended test procedure. It's difficult to write a good automatic regression test for this issue, hence noreg-hard.
23-08-2013

SUGGESTED FIX --- old/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java 2012-02-13 15:50:57.166173139 +0800 +++ new/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java 2012-02-13 15:50:56.962172141 +0800 @@ -105,7 +105,6 @@ this.target = target; //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK); - target.enableInputMethods(true); firstChangeSkipped = false; String text = ((TextArea)target).getText(); @@ -113,7 +112,6 @@ jtext.setWrapStyleWord(true); jtext.getDocument().addDocumentListener(jtext); XToolkit.specialPeerMap.put(jtext,this); - jtext.enableInputMethods(true); textPane = new AWTTextPane(jtext,this, target.getParent()); setBounds(x, y, width, height, SET_BOUNDS); --- old/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java 2012-02-13 15:50:57.722175858 +0800 +++ new/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java 2012-02-13 15:50:57.518174860 +0800 @@ -73,8 +73,6 @@ xtext = new XAWTTextField(text,this, target.getParent()); xtext.getDocument().addDocumentListener(xtext); xtext.setCursor(target.getCursor()); - target.enableInputMethods(true); - xtext.enableInputMethods(true); XToolkit.specialPeerMap.put(xtext,this); TextField txt = (TextField) target;
21-02-2012

EVALUATION http://cr.openjdk.java.net/~littlee/OJDK-124/webrev.01/
21-02-2012

EVALUATION Patch submitted: http://mail.openjdk.java.net/pipermail/awt-dev/2012-February/002262.html
17-02-2012