关于Event
问两个问题:
怎么样监听鼠标是否按了右键.
怎么样监听键盘是否按下组合键(Shift+O)
------解决方案-------------------- public mouseClicked(MouseEvent e)
{
if(e.isMetaDown())//检测鼠标右键
{
System.out.println( "MouseEvent test successfucl! ");
}
}
public void keyPressed(KeyEvent e)
{
if(e.isShiftDown() && e.getKeyCode() == KeyEvent.VK_0)//监测shift+0
{
System.out.println( "KeyEvent test successfucl! ");
}
}