Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > KeyAdapter not getting input on JLabel when Frame maximized in windows

Reply
Thread Tools

KeyAdapter not getting input on JLabel when Frame maximized in windows

 
 
chadsinge@gmail.com
Guest
Posts: n/a
 
      06-05-2006
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.

 
Reply With Quote
 
 
 
 
Vova Reznik
Guest
Posts: n/a
 
      06-05-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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?
 
Reply With Quote
 
 
 
 
chadsinge@gmail.com
Guest
Posts: n/a
 
      06-06-2006
we're basically having them enter a sort of password to unlock a hidden
menu. using a text field would be too obvious.

Vova Reznik wrote:
> (E-Mail Removed) wrote:
> > 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?


 
Reply With Quote
 
Vova Reznik
Guest
Posts: n/a
 
      06-06-2006
(E-Mail Removed) wrote:
> we're basically having them enter a sort of password to unlock a hidden
> menu. using a text field would be too obvious.
>
> Vova Reznik wrote:
>> (E-Mail Removed) wrote:
>>> 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?

>


Then javax.swing.JPasswordField.
 
Reply With Quote
 
chadsinge@gmail.com
Guest
Posts: n/a
 
      06-07-2006
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.


Vova Reznik wrote:
> (E-Mail Removed) wrote:
> > we're basically having them enter a sort of password to unlock a hidden
> > menu. using a text field would be too obvious.
> >
> > Vova Reznik wrote:
> >> (E-Mail Removed) wrote:
> >>> 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?

> >

>
> Then javax.swing.JPasswordField.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
label setCursor not working when main frame is maximized Chris Java 5 05-19-2008 02:03 PM
Re: How to keep windows maximized matbauer@hotmail.com Computer Support 4 01-24-2005 08:53 PM
Windows keep getting resized/maximized sinjon Computer Support 5 04-09-2004 11:24 PM
problem with keyadapter / java application Michi Java 0 07-14-2003 06:12 PM
maximized and minimized windows pp Computer Support 3 07-04-2003 06:54 PM



Advertisments