Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Arrow Keys again
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
eclipto




PostPosted: Tue Dec 19, 2006 11:58 am   Post subject: Arrow Keys again

I have figured out the method for keyPressed,keyReleased, etc but i dont know how do actually return the method. Could someone tell me what do do? Question
Sponsor
Sponsor
Sponsor
sponsor
OneOffDriveByPoster




PostPosted: Tue Dec 19, 2006 11:02 pm   Post subject: Re: Arrow Keys again

Call addKeyListener on the component (object) you want to associate your KeyListener with. Your methods need to be in a class that implements the KeyListener interface. Links below should help.
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/KeyAdapter.html
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Component.html#addKeyListener(java.awt.event.KeyListener)

(Forgive me for not hunting down the topic where this came from if the links, etc. were there already).
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: