how to trigger button using shortcut keys

Hi Friends i want to trigger a button in java swings using keyboard keys.

for ex: a button called "Enter" either i click mouse or i press ALT+E to trigger it.

Plz give me sample coding if u have

By

vinod

[234 byte] By [brainvinod@yahoo.co.ina] at [2007-11-27 10:21:33]
# 1

Try looking at the tutorials...

http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html

c0demonk3ya at 2007-7-28 17:10:41 > top of Java-index,Desktop,Core GUI APIs...
# 2

use button.setMnemonic("E");

triggers ALT+E

Message was edited by:

Yannix

Yannixa at 2007-7-28 17:10:41 > top of Java-index,Desktop,Core GUI APIs...