Search:

Type: Posts; User: antihero.mc

Search: Search took 0.08 seconds.

  1. Replies
    12
    Views
    1,063

    Re: need help with consuming key events.

    So it looks like the simplest solution is to just check if the value is equal to "n" (110) and consume it. Thanks again to Norm and Greg.



    import java.awt.event.KeyEvent;
    import...
  2. Replies
    12
    Views
    1,063

    Re: need help with consuming key events.

    Sorry. Still pretty green. I don't know where you're finding that.

    --- Update ---

    AHHHH ok thank you both.
  3. Replies
    12
    Views
    1,063

    Re: need help with consuming key events.

    Hmmm. None are 'n'. All of the KeyEvents are actual integers. But it seems like somehow allowing decimals through is also allowing the "n" key through and even consuming the "n" key specifically...
  4. Replies
    12
    Views
    1,063

    Re: need help with consuming key events.

    Thanks for the quick reply. Here it is:



    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;

    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import...
  5. Replies
    12
    Views
    1,063

    need help with consuming key events.

    I am trying to create an event handler for two JTextFields to only allow numerical input. It consumes all letter but for some reason the "n" key still gets through. I have the spaghetti code below....
Results 1 to 5 of 5