what is java's corresponding method for c's getch()
hi... i intended to do a game in java.. In that i needed some keyboard controls for making the movements like up, down, left and right using some keys.. But actually, i need something like C's getch() function to take the keyboard strokes... can anyone find out the corresponding method in java or any other construct which helps in doing so..
|
If you want to act on keys being pressed, you need to do this with event handling in Java. This class might be useful.
|
hi,
plz check the following link : http://java.sun.com/j2se/1.4.2/docs/api/ there are a lots of funcyion available in java.io package ,so try whichever suites u. Urs Lokesh |
yes.. i tried the event handling.. it is working.. have to use the KeyListener Interface for the purpose... thanx for the answer...
|
All times are GMT -5. The time now is 03:53 AM. |