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

Swing applications don't support international keyboards under Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.3.1, 1.4.0
    • client-libs
    • hopper
    • x86
    • linux



      Name: jk109818 Date: 01/23/2002


      FULL PRODUCT VERSION :
      java version "1.4.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
      Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)

      FULL OPERATING SYSTEM VERSION :Linux 2.4.2-2 i686


      ADDITIONAL OPERATING SYSTEMS :NONE



      EXTRA RELEVANT SYSTEM CONFIGURATION :
      I use an internation keyboard (French Canadian keyboard)
      supported by XFree86. I suspect the problem is the same with
      any international keyboard.

      XFree86 currently in use: 4.0.3-5 (Linux RedHat 7.1)

      A DESCRIPTION OF THE PROBLEM :
      With the French Canadian keyboard, we can't generate keys
      such as [, ], { which are usually generated by typing
      "altcar" (right alt) with a dead key (appearing as `,[, ]
      under a us keyboard).

      This works with AWT applications, it only fails with Swing
      applications.

      This effectively makes non-English Swing applications under
      Linux impossible.

      This is the same bug as

      http://developer.java.sun.com/developer/bugParade/bugs/4371923.html

      but I've worked hard to add more useful info.

      Note the the bug is misclassified under AWT when it is a
      Swing bug! Note also that it doesn't matter whether it is a
      German or French or French Canadian keyboard, so you should
      say "internation keyboard" instead.

      Note that I give precise steps to reproduce the problems,
      even with a us keyboard and without knowing anything about
      non-us keyboards!!!

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. setxkbmap ca_enhanced
      2. Holding the right alt down and pressing [, you should see
      "[" appear. Pressing [ alone does nothing. Pressing [
      followed by "space" returns ^ ([ acts as a dead key).

      You can verify that this works for all AWT apps and all
      Linux apps.

      3.Install JDK 1.4 rc
      4.cd /usr/java/j2sdk1.4.0/demo/jfc/Notepad
      5. /usr/java/j2sdk1.4.0/bin/java -jar Notepad.jar

      6. Try typing "right-alt" and "[", you will noticed that
      nothing happens.
      At this point, Notepad opens but you can't generate [,], {
      if you set the keyboard to French Canadian

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      During step 6., I expect "[" to come up in the text pane of
      Notepad.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      I'm not sure they are relevant, but here's what appears when I launch a Swing app.

      Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to type VirtualBinding
      Warning: Cannot convert string "<Key>Home,_Key_Begin" to type VirtualBinding
      Warning: Cannot convert string "<Key>F1,_Key_Help" to type VirtualBinding
      Warning: Cannot convert string "Shift<Key>F10,_Key_Menu" to type VirtualBinding
      Warning: Cannot convert string "<Key>F10,Shift_Key_Menu" to type VirtualBinding
      Warning: Cannot convert string "<Key>KP_Enter,_Key_Execute" to type VirtualBinding
      Warning: Cannot convert string "Alt<Key>Return,Alt_Key_KP_Enter" to type
      VirtualBinding

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class SwingTest {
        public static void main( String[] args ) {
          JFrame f = new JFrame();
          f.getContentPane().add( new JTextField( 40 ) );
          f.pack();
          f.show();
        }
      }


      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Switch temporarily to a US keyboard (by typing 'setxkbmap
      us', for example - and 'setxkbmap ca' to come back to French
      for instance.

      Unfortunately, this effectively deactivate the international
      keyboard and makes typing in non-English languages very
      difficult (can't generate accents such as à, é, ...).
      (Review ID: 138669)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: