problem in using getKeyCode()

problem in using getKeyCode()

i am working with the jlist...while i was trying to use the arrow keys in the keyboard to select the values in the list it is not working properly...the code which i used is given below....

if (evt.getKeyCode() == KeyEvent.VK_DOWN) { // Do stuff. if (jList.getSelectedIndex() == lsm.getSize() - 1) {/lsm is the default list model/ jList.setSelectedIndex(0); jList.setVisible(false); } else { jList.setSelectedIndex(jList.getSelectedIndex() + 1); } }

View Answers









Related Tutorials/Questions & Answers:

Ads