Event listeners not working properly
On my home computer everything works fine, but on my laptop i downloaded the new jdk version 6 and for some reason or another, none of the recent event listeners work (ie. MouseListener, KeyListener), and there are also some other classes and interfaces that don't work. However, i did some testing and the deprecated methods (public boolean keyPressed() ) work for some reason. Does any1 have any idea why this would be?
# 2
ok the new api
public class thisGameOfMine implements Runnable, KeyListener
// Runnable works, but not the KeyListener - it gets a compiling error
{
// rest of code....
public void keyPressed(KeyEvent e)
{
// this method won't compile
}
}
however, the old API works
public class thisGameOfMine implements Runnable
{
//rest of code.....
public boolean keyDown(Event e, int key)
{
this compiles just fun, but it doesn't run properly
}
}
if these examples aren't sufficient, just let me know, thanks