hello, I got this maze source code from the internet but I would like to change it so that the movement uses keypad (UP,DOWN,LEFT,RIGHT) instead of mouselistener
tried I changed all the mouse functions to use keylistener instead but I get these errors:
H:\Java\maze\MazeApplet.java:365: cannot resolve symbol
symbol : method getPoint ()
location: class java.awt.event.KeyEvent
Point p = new Point(e.getPoint());
^
H:\Java\maze\MazeApplet.java:366: cannot resolve symbol
symbol : method getX ()
location: class java.awt.event.KeyEvent
int x = e.getX();
^
H:\Java\maze\MazeApplet.java:367: cannot resolve symbol
symbol : method getY ()
location: class java.awt.event.KeyEvent
int y = e.getY();
^
3 errors
H:\Java\maze\MazeApplet.java:365: cannot resolve symbol
symbol : method getPoint ()
location: class java.awt.event.KeyEvent
Point p = new Point(e.getPoint());
there is no getPoint() in KeyEvent class. there is no location for a key event at all. getX, getY are functions for a mouseevent, which has a location on the screen, and not for a keyevent, which has no location but the keyboard itself. remove all code corresponding to the location of the mouse.
Bookmarks