I've got this problem with an applet.
I've always found the handleEvent method to work perfectly for me
before and I can't see what I'm doing differently.
I try the following code
public boolean handleEvent(Event e)
{
switch(e.id)
{
case Event.KEY_ACTION:
case Event.KEY_PRESS:
{
switch(e.key)
{
case Event.LEFT:
{
ball_x[0][0]-=100;
repaint();
break;
}
}
break;
}
}
return(false);
}
Debugging I find this works if I put the lines
"ball_x[0][0]-=100;repaint();" outside the switch statments, i.e. it
works for all mouse events like moving the mouse , but it doesn't
even work for any keys never mind pressing the left-arrow key.
It's probably a lot to ask, seen as I haven't given the whole
program, but does anybody know what could be wrong here?