Didn't know where to post this but I think it belongs here...
Well... I have got this ImageButton class wich makes buttons of images, but it seems to be a little out of date and it uses the public boolean action(Event e, Object arg) method for event handling... If I remember correctly it's also deprecated to do it this way and that you should register the component as ActionListener instead. But... I have no idea how to do it, the only thing I can say about the ImageButton class is that it is extending Canvas.
Here is the method handling button actions:
public boolean action(Event e, Object arg) {
if (e.target instanceof ImageButton) {
ImageButton button = (ImageButton)e.target;
int i = findColor(button);
if (i>=0) {
// currentColor = i;
} else {
System.out.println("unknown image button pressed");
}
}
return true;
}