> I have a JLabel that has a KeyAdapter attached to it that waits for
> input, and when the user enters a specific string, it does something.
> This works fine when the window isn't maximised, I can see the input in
> System.out's that I added, but when I maximise the window, I can no
> longer see that the JLabel is receiving the input. Could this be a bug
> in the Windows JRE? I'm using Windows 2k and Java 1.4.2_11.
Looks like your label lost the focus.
Why do you use JLabel for user input instead of JTextField for example?
chadsinge@gmail.com - 06 Jun 2006 17:34 GMT
we're basically having them enter a sort of password to unlock a hidden
menu. using a text field would be too obvious.
> > I have a JLabel that has a KeyAdapter attached to it that waits for
> > input, and when the user enters a specific string, it does something.
[quoted text clipped - 5 lines]
> Looks like your label lost the focus.
> Why do you use JLabel for user input instead of JTextField for example?
Vova Reznik - 06 Jun 2006 17:41 GMT
> we're basically having them enter a sort of password to unlock a hidden
> menu. using a text field would be too obvious.
[quoted text clipped - 8 lines]
>> Looks like your label lost the focus.
>> Why do you use JLabel for user input instead of JTextField for example?
Then javax.swing.JPasswordField.
chadsinge@gmail.com - 07 Jun 2006 15:22 GMT
I didn't even want to give the appearance that there was an option to
type something in. You had to be in the know. I finally chose a
JTextField and modified the Caret, Document, and Cursor to all be
hidden/not blink/etc., so it was completely transparent.
> > we're basically having them enter a sort of password to unlock a hidden
> > menu. using a text field would be too obvious.
[quoted text clipped - 10 lines]
>
> Then javax.swing.JPasswordField.