比如说vk_0,vk_1.......
但是'.'用vk_period获取不了,请教大虾相助!

解决方案 »

  1.   

    小键盘的是VK_DECIMAL,大余号的那个才是VK_PERIOD
      

  2.   

    但是我的VK_PERIOD
    用不起是怎么回事哦?
      

  3.   

    import java.awt.* ;
    import java.awt.event.* ;
    import javax.swing.* ;public class TestKey extends JFrame
    {
    TestKey()
    {
    this.setSize( 400, 300 ) ;
    this.addKeyListener( new KeyAdapter()
    {
    public void keyPressed(KeyEvent e) 
    {
    if( e.getKeyCode() == KeyEvent.VK_PERIOD )
    {
    JOptionPane.showMessageDialog( null, "hello", "hello", 0 ) ;
    }
    }
    }) ;

    this.setVisible( true ) ;
    }

    public static void main ( String args[] )
    {
    new TestKey() ;
    }
    }