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

Bad character displayed in Java TextField using french keyboard

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.0.2
    • client-libs
    • None
    • sparc
    • solaris_2.5.1

      With JDK 1.0.2 or 1.1_final using a french keyboard
      under Solaris 2.x, when you press the '&' key In a
      TextField component you get a '1' character.
      This problem occur for many characters

      ie:

      & -> 1
      " -> 3
      ( -> 5
      _ -> 8
      ) -> °
      = -> =
      * -> µ
      ...

      Configuration:

      Solaris 2.5 US sparc platform french keyboard (layout 23)
      JDK 1.0.2 or JDK 1.1_final (02/18/97)

      You can reproduice the problem using the simple code below :

      /////////////////////////////////////////////////////////////////////////////
      import java.awt.* ;

      public class AZERTY extends Frame
      {
         private TextField textfield ;

         public AZERTY()
         {
            super("AZERTY") ;
            textfield = new TextField ("", 30) ;
            setLayout ( new FlowLayout(FlowLayout.LEFT) ) ;
            add (textfield) ;
         }

         public boolean handleEvent (Event evt)
         {
            if (evt.target.equals(textfield))
               System.out.println(evt.id + ", " + evt.key + ", " + evt.modifiers) ;
            if (evt.id == Event.WINDOW_DESTROY)
            {
               hide () ;
               dispose () ;
               System.exit (0) ;
               return false ;
            }
            else return super.handleEvent(evt) ;
         }

         public static void main (String args[])
         {
            AZERTY azerty = new AZERTY () ;
            azerty.pack() ;
            azerty.show() ;
         }
      }
      /////////////////////////////////////////////////////////////////////////////

            nishimur Naoyuki Ishimura (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: