Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2007, 02:31 PM
Member
 
Join Date: Nov 2007
Posts: 8
kavithas is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-06-2007, 08:22 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,124
hardwired is on a distinguished road
Do you mean the constant field value for the key? From the KeyEvent api:
KeyEvent.VK_F4 = 115
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-10-2007, 01:02 PM
Member
 
Join Date: Nov 2007
Posts: 8
kavithas is on a distinguished road
Hi Hardwired,

Can you tel me how to get the key Pressed event at runtime?
Please can you send me any code or example ..
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-10-2007, 01:21 PM
Member
 
Join Date: Dec 2007
Posts: 12
Abdul Ajis is on a distinguished road
Implement the key listener
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-10-2007, 01:25 PM
Member
 
Join Date: Nov 2007
Posts: 8
kavithas is on a distinguished road
Hi Abdul,

I am not getting how to get the keyboard event on press of F4?
can you expalin me with example?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 12-10-2007, 02:19 PM
Member
 
Join Date: Dec 2007
Posts: 12
Abdul Ajis is on a distinguished road
Event
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 12-10-2007, 03:01 PM
Member
 
Join Date: Dec 2007
Posts: 4
Rama Koti Reddy is on a distinguished road
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 .
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display a sum of all previously pressed numbers in JTextField? all eyes New To Java 2 03-30-2008 09:38 PM
when muse pressed the background change pcman Java Applets 1 03-18-2008 12:51 AM
MouseDragged Event Preethi New To Java 1 03-04-2008 06:09 AM
Event nt5515 New To Java 0 02-15-2008 05:44 PM
Event Handling luisarca Sun Java Wireless Toolkit 5 05-07-2007 07:05 PM


All times are GMT +3. The time now is 08:58 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org