-
Arrow Key Input
Alright, i cannot figure out for the life of me how to take arrow key input. The only thing i've found on it is how to do it regarding an applet. My program is not an applet... so it didn't work when I tried it. Any suggestions?
Thanks
Runesoul
-
Is this a command line input? If so, i'm not sure you can get the arrow key. If you're using a keylistener then it should work. You'll have to look in the KeyEvent API to see.
-
My program is running in a Frame. I looked at the KeyEvent API and it seemed like you had to have something to take focus before you can use a key listener. This presents a problem for me because all I have in the Frame are Images...
Anyone know of a way I could get around this?
Runesoul
-
You can make the frame request focus. Look in the API for Frame, the method will either be in there on one of the superclasses....
-
implement the KeyListener interface in a class and add it
MyFrame.addKeyListener()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks