JDK-4096710 : TextArea.getText () method fails to return MultiCharsetString
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1
  • CPU: x86
  • Submitted: 1997-12-03
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
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.
Other
1.2.0 1.2beta3Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
JDK version : 1.2X
Platform    : Win 95
Locale      : ja

To reproduce:
- Run the following program on non-English version of Win32 envirenment.
- After bring up the application, key in some Chinese or Japanese
- Click "Print" button, and find out it cannot print the characters just typed in. 


import java.awt.*;
import java.awt.event.*;
import java.util.Locale;
import java.util.ResourceBundle;

    public class PanelTextArea extends Frame
    {

        public PanelTextArea()
        {
            setTitle("Text Area");
            Panel p = new Panel();
            p.setLayout(new FlowLayout());

            Locale myLocale = Locale.getDefault();

            Button btn = new Button ("Print");
            p.add(btn);
            add("North",p);
            setTitle("Text Area");
            Panel p = new Panel();
            p.setLayout(new FlowLayout());

            Locale myLocale = Locale.getDefault();

            Button btn = new Button ("Print");
            p.add(btn);
            add("North",p);
            ta = new TextArea( 8,40 );
            ta.setLocale(myLocale);
            add("Center",ta);

            btn.addMouseListener (new mListener());
            addWindowListener (new wListener());
        }

        class wListener extends WindowAdapter
        {
                public void windowClosing (WindowEvent we)
                {
                        we.getWindow().dispose();
                        System.exit(0);
                }
        };


        class mListener extends MouseAdapter
        {
            public void mouseClicked(MouseEvent me)
            {
                String str = ta.getText();
                System.out.println(str);
            }
        };

        public static void main( String[] args)
        {
            Frame f = new PanelTextArea();
            f.setSize(300,200);
            f.show();
        }

        private TextArea ta;
    }

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2beta3 FIXED IN: 1.2beta3 INTEGRATED IN: 1.2beta3
14-06-2004

EVALUATION awt_TextComponent.cpp assumed the UTF encoding on Win95. masayoshi.okutsu@Eng 1998-03-06
06-03-1998