Okay I need help with this , My Brain thinks it's right but the keyevent compiles but doesn't do anything, I have it set , so that that code get's users keycode, Then If the item in the list box is selected and they press d, the item is removed. I can't figure out why it doesn' work.

public void keyTyped(KeyEvent event) {
int code = event.getKeyCode();
if (code == KeyEvent.VK_D) {
String [] items = lstbox.getSelectedItems();
for (int i = 0; i < items.length; i ++) {
lstbox.remove(i);
}
}
}