Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4312168
Votes 45
Synopsis New windows switch to default locale's keyboard, ignoring Windows default kbd
Category java:classes_awt_im
Reported Against 1.3 , kestrel , kestrel-rc1 , kestrel-rc3
Release Fixed 1.3.1(ladybird)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 4312443 , 4334696 , 4336610 , 4340102 , 4346221 , 4375407
Submit Date 12-FEB-2000
Description
.This is extracted from bug 4305718, replicated from 4309559:

ON WinNT
   launch "Regional Settings" control panel
   Select "Input Locales" tab
   Add Czech input locale
   Select "Regional Settings" tab
   Set Czech to be the current settings.
     Note: You do not have to check "Set as system default locale" check box
From a dos shell:
   <see attachment for source to Bug1.java>
   javac -d . Bug1.java  
   java -classic Bug1
Result:
   The input method has been changed to Czech. although, 
   the default input locale is English (United States) 


The fix for 4309559 removed the specification that requires this behavior; this bug serves to request a change in the actual behavior.
Work Around
For applications: Call java.awt.im.InputContext.selectInputMethod with desired locale.

For end user:
- use ALT+SHIFT when a windows opens to select the desired keyboard, or
- delete the undesired keyboard layout from the list of input locales in the Regional Settings control panel, so that the keyboard layout does not get changed.
Evaluation
Needs to be looked into again for Ladybird.
 xxxxx@xxxxx  2000-02-11
Comments
  
  Include a link with my name & email   

Submitted On 14-MAY-2000
maxom
This bug present also on JDK1.3.0 (final) - I'm using Win 
NT 4.0 SP5 (Russian). This problem forces Russian (and non-
English) developers to use JDK 1.2.2, which has no this bug.
I wonder what for SUN has wrote that this bug fixed in RC2 ?


Submitted On 10-AUG-2000
stenling1
This bug is also a major problem for users of the Dvorak 
keyboard layout and JDK 1.3.
When both Dvorak and QWERTY keyboard layouts are installed 
the user have to use JDK 1.2.2.


Submitted On 17-OCT-2000
saxtell
You can work around this problem by passing in a new locale 
at the command line:
eg
-Duser.region=ES 

This will force the keyboard layout to be Spanish for 
example.


Submitted On 20-OCT-2000
maxom
to saxtell:
For WinNT 4.0SP5(RUSSIAN) method
-Duser.region=code doesn't work.


Submitted On 06-NOV-2000
halbritter
We worked around the problem by using our own subclasses of 
Window in which we defined our own getInputContext() method 
that returns an InputContext object initialized with 
an 'empty' Locale.
With that the keyboard type is set to the default input 
locale.
We are not sure if this work-around is side-effect free, 
but it seems to work properly in our application.
The code looks like this:
 import java.awt.im.*;
 [...]
 protected InputContext inputContext;
 public InputContext getInputContext() {
  if (inputContext == null) {
   inputContext = new FixedInputContext();
  }
  return inputContext;
 }
 protected class FixedInputContext extends InputContext {
  public FixedInputContext() {
   super();
   super.selectInputMethod(new java.util.Locale(&quot;&quot;, &quot;&quot;));
  }
 }



Submitted On 22-JAN-2001
Yatima
Same problem occurs in an AWT *Applet* inside a
java.awt.TextArea using:

Microsoft Windows 2000 Service Pack 1
Microsoft Internet Explorer 5.00.3103.100
Java Plug-In Standard International Edition 1.3.0-C
  (could not get 1.3.0_1 to adequately work as 
   non-Administrative user)
...a swiss keyboard
...the loaded locales French (Switzerland) 
                      English (Unites States) 
...with French the 'default input locale'
...and 'English (United States)' as 'your locale'
   (is this the same as the system default locale??)

The TextArea assumes I have a US keyboard.
But the ALT+SHIFT workaround is ok...for now.

(The applet currently resides at:
 http://val2.synapse.lu/smsapplet-english.htm)


Submitted On 22-MAR-2001
jdcjdc
Swing text areas don't function correctly with the Dvorak keyboard layout.

Platform: Win2k

Simulation:

1. Change QWERTY layout to Dvorak layout
(Start--&gt;Control Panel--&gt;Keyboard--&gt;Language--&gt;Properties--&gt;United States-Dvorak--&gt;OK)

2. Start a Java Swing application that uses a text area (e.g. jEdit).

3. Type something into the editor window. The keyboard works like a
    Dvorak keyboard.

4. Switch to some other window by pressing ALT+TAB. Switch back to
   the Java app by pressing ALT+TAB.

5. Type something into the editor. The keyboard handler malfunctions
    behaving like QWERTY board.

6. Switch to some other window by pressing ALT+TAB. Switch back to
   the Java app by pressing ALT+TAB.

7. Type something into the editor. The Dvorak layout is functioning correctly now.

8. loop end -- goto step 4.



PLEASE NOTE: JDK6 is formerly known as Project Mustang