This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
int key=evt.getKeyCode(); System.out.print(key); if(key==KeyEvent.VK_ENTER){ JOptionPane.showMessageDialog(this, "Hello world"); } When keys Enter is pressed a dialog box will be open. But when space key is also pressed the same dialog box will be open.Please help me to solve this bug.
This problem is related to java codding not NetBeans, so I'm closing it now. But anyway the code you've provided should work correctly for enter, at is works fine for me. Maybe you have another condition somewhere in the code. It is hard to tell without whole class source.