Mailinglist Archive: opensuse-programming (33 mails)

< Previous Next >
Java AWT problem with less-than key
  • From: Peter Szaban <pszaban@xxxxxxxx>
  • Date: Mon, 10 Jan 2005 21:51:04 -0500
  • Message-id: <20050111025104.GA15565@xxxxxxxxxxxxx>
Hello,

I've been fighting with a Java problem that only appears on Intel SuSE Pro
9.0-9.2 machines running KDE (as far as I know). When using the keyboard to
enter text into an AWT TextField. Less-than "<" is getting converted to
greater-than ">".

Yast says keyboard is set to "English (US)". For fun, I tried "export
LANG=en_US" (as opposed to en_US.UTF-8) to no avail. I am not (knowingly)
messing with keymaps anywhere.

Java appears to recognize the keycodes properly, as it correctly
interprets the un-SHIFT-ed key as comma ",". A preloaded less-than sign
is correctly displayed, but when the less-than key (SHIFT-comma) is entered at
the keyboard, it gets converted to greater-than.

Anybody else experienced this, or worked around it? Any helpful comments
would be much appreciated.

Maybe I'm just dense, but I can't find any key combination that will put a
less-than sign in the TextField. Here's a sample program to illustrate
the problem. Run the program and try keying a less-than sign into the
TextField:


8X-------------- Test7.java ----------------------------X8
// Compiled with: /usr/lib/java/bin/javac Test7.java
// Executed from Konsole window with: /usr/lib/java/bin/java Test7

import java.awt.*;

public class Test7
{
public static void main( String argv[] )
{
Dialog d = new Dialog( new Frame() );
TextField ts = new TextField( "Try typing a < in here" );
d.add( ts );
d.pack();
d.setVisible( true );
}
}
8X-------------- Test7.java ----------------------------X8

Java version:
$ rpm -qa | grep java
java-1_4_2-sun-1.4.2.05-9
java-1_4_2-sun-devel-1.4.2.05-9



< Previous Next >
Follow Ups