Results 1 to 8 of 8
  1. #1
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Red face key pressed event

    Hi All,

    Can any one tell how to get the Ascii value of F4 when F4 is pressed?


    Thanks and Regards
    Kavitha

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Do you mean the constant field value for the key? From the KeyEvent api:
    KeyEvent.VK_F4 = 115

  3. #3
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Default

    Hi Hardwired,

    Can you tel me how to get the key Pressed event at runtime?
    Please can you send me any code or example ..

  4. #4
    Abdul Ajis is offline Member
    Join Date
    Dec 2007
    Posts
    12
    Rep Power
    0

    Default

    Implement the key listener

  5. #5
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Default

    Hi Abdul,

    I am not getting how to get the keyboard event on press of F4?
    can you expalin me with example?

  6. #6
    Abdul Ajis is offline Member
    Join Date
    Dec 2007
    Posts
    12
    Rep Power
    0

  7. #7
    Abdul Ajis is offline Member
    Join Date
    Dec 2007
    Posts
    12
    Rep Power
    0

  8. #8
    Join Date
    Dec 2007
    Posts
    4
    Rep Power
    0

    Default

    KeyStroke group = KeyStroke.getKeyStroke(KeyEvent.VK_F4);
    tfGroup.getInputMap().put(group, "Group");
    Action groupAction = new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
    // add ur code here
    }
    };
    tfGroup.getActionMap().put("Group", groupAction);
    here tfGroup is TextField(Java Component) . when the Focus is on this tfGroup then press F4 .

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2008, 09:38 PM
  2. when muse pressed the background change
    By pcman in forum Java Applets
    Replies: 1
    Last Post: 03-18-2008, 12:51 AM
  3. MouseDragged Event
    By Preethi in forum New To Java
    Replies: 1
    Last Post: 03-04-2008, 06:09 AM
  4. Event
    By nt5515 in forum New To Java
    Replies: 0
    Last Post: 02-15-2008, 05:44 PM
  5. Event Handling
    By luisarca in forum Sun Java Wireless Toolkit
    Replies: 5
    Last Post: 05-07-2007, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •