Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4106321

jdb does not display multi-byte code.

XMLWordPrintable

    • b01
    • x86, sparc
    • solaris_2.5.1, windows_nt
    • Not verified



        Name: diC59631 Date: 01/23/98


        System.out class does not display multi-byte code, Japanese in my case,
        given by keyTyped event from the input method server when the program
        run by jdb. When the program is run directly by java, the System.out
        displays the Japanese EUC code. The same problem can be found in JDK1.2b2.
        Following source code demostrates this problem.
         
        %javac TextFieldTest.java
        %java TextFieldTest
          -- Japanese text code in EUC is displayed in kterm.
        %javac -g TextFieldTest.java
        %jdb TextFieldTest
          -- This does not display Japanese text code.
         
         
        import java.util.*;
        import java.awt.*;
        import java.awt.event.*;
         
         public class TextFieldTest extends Frame implements java.awt.event.KeyListener,java.awt.event.M
        ouseListener{
                TextField text1;
                Label label2;
         
                public static void main(String argv[]){
         
                        TextFieldTest app = new TextFieldTest();
                        app.start();
                }
                
                public void paint(Graphics g){
                }
                
                
                public TextFieldTest(){
                        super("SimpleText");
                        init();
                }
         
                public void init() {
                        setSize(320, 240);
                        this.setLayout(new java.awt.GridLayout(2,1));
                        text1 = new TextField("Type");
                        label2 = new Label("Away!");
                        add(text1);
                        add(label2);
                        this.text1.addKeyListener(this);
                        this.text1.addMouseListener(this);
                        this.label2.addKeyListener(this);
                        this.label2.addMouseListener(this);
                        paint(getGraphics());
                        
                }
                
                public void start(){
                        setVisible(true);
                }
                
                
                public void keyPressed(java.awt.event.KeyEvent event)
                {
                        System.out.println(event.toString());
                }
                public void keyReleased(java.awt.event.KeyEvent event)
                {
                        System.out.println(event.toString());
                }
                public void keyTyped(java.awt.event.KeyEvent event)
                {
                        System.out.println(event.toString());
                        Component component=event.getComponent();
                        if(component == label2) {
                                label2.setText(String.valueOf(event.getKeyChar()));
                                text1.setText(String.valueOf(event.getKeyChar()));
                        }
                }
                
                public void mouseClicked(java.awt.event.MouseEvent event)
                {
                }
                public void mouseEntered(java.awt.event.MouseEvent event)
                {
                }
                public void mouseExited(java.awt.event.MouseEvent event)
                {
                }
                public void mousePressed(java.awt.event.MouseEvent event)
                {
                        Component component=event.getComponent();
                        if(component == label2)
                                component.requestFocus();
                }
                public void mouseReleased(java.awt.event.MouseEvent event)
                {
                }
         
         
        }
        //end of file
        (Review ID: 23878)
        ======================================================================

              ghirschsunw Gordon Hirsch (Inactive)
              dindrigo Daniel Indrigo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: