posted 22 years ago
I have a problem with adding two listener types. My code is as follows.
class MyListeners implements KeyListener, MouseMotionListener
{
// all methods for both interfaces are //included
}
This class compiles fine. In another class I have this code :
JInternalFrame jif = a valid frame;
jif.addKeyListener(new MyListeners());
jif.addMouseMotionListener(new MyListeners());
This piece of code errors when I try to compile. It's having problems with adding the MouseMotionListener because if I comment out that line it works just fine.
Can anybody give any insight into what the problem is? The actual compiler error says the Component cannot be applied to MyListeners. Is there a problem adding MouseMotionListeners to JInternalFrames?
Many thanks.
Paul