如何同时监听keylistener和MouseMotionListener(200分)

  • 主题发起人 主题发起人 catguy
  • 开始时间 开始时间
C

catguy

Unregistered / Unconfirmed
GUEST, unregistred user!
在监听
class MousePanel extends JPanel implements MouseMotionListener
的同时,我想在MousePanel中同时监听keylistener,
怎么办???????
 
implement the keyListener.
and realize the keyTyped, keyPressed, keyReleased functions in your MousePanel.
 
class MousePanel extends JPanel implements MouseMotionListener, KeyListener
{
// 实现两个接口的抽象函数
}
这就是接口实现C++的多继承,和Delphi一样的
 
接受答案了.
 
后退
顶部