W
wee
hello,
i added an actionListener to a JButton. it works well when i click it with a mouse. if i put the focus on the button using the tab key and press the keyboard enter key, nothing happens. my question then is, how can i make theJButton react to both mouse click and the keyboard enter key? do i need toadd a keypressed listener on top of the actionListener? any help would be appreciated.
thank you.
i added an actionListener to a JButton. it works well when i click it with a mouse. if i put the focus on the button using the tab key and press the keyboard enter key, nothing happens. my question then is, how can i make theJButton react to both mouse click and the keyboard enter key? do i need toadd a keypressed listener on top of the actionListener? any help would be appreciated.
thank you.