KeyAdapter not getting input on JLabel when Frame maximized in windows

Discussion in 'Java' started by chadsinge@gmail.com, Jun 5, 2006.

  1. Guest

    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.
    , Jun 5, 2006
    #1
    1. Advertising

  2. Vova Reznik Guest

    Re: KeyAdapter not getting input on JLabel when Frame maximized inwindows

    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?
    Vova Reznik, Jun 5, 2006
    #2
    1. Advertising

  3. Guest

    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:
    > 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?
    , Jun 6, 2006
    #3
  4. Vova Reznik Guest

    Re: KeyAdapter not getting input on JLabel when Frame maximized inwindows

    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:
    >> 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.
    Vova Reznik, Jun 6, 2006
    #4
  5. Guest

    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:
    > 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:
    > >> 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.
    , Jun 7, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michi
    Replies:
    0
    Views:
    515
    Michi
    Jul 14, 2003
  2. desh
    Replies:
    1
    Views:
    406
    Brzezi
    Apr 17, 2006
  3. sjoerd

    display "maximized"

    sjoerd, Oct 15, 2003, in forum: HTML
    Replies:
    27
    Views:
    1,114
    Hywel Jenkins
    Oct 17, 2003
  4. ~john
    Replies:
    0
    Views:
    317
    ~john
    Sep 1, 2006
  5. Chris
    Replies:
    5
    Views:
    2,182
    Chris
    May 19, 2008
Loading...

Share This Page