Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

KeyAdapter not getting input on JLabel when Frame maximized in windows

Thread view: 
chadsinge@gmail.com - 05 Jun 2006 22:20 GMT
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.
Vova Reznik - 05 Jun 2006 22:28 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.