-
Help on KeyEvents
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);
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks