Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Shortcut key for button click  RSS feed

 
Vijay Bhuruk
Ranch Hand
Posts: 31
MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a applicaton in Swing.

Application have two buttons(Ok_button and Cancle_button) on a form.user clicks on these button with mouse or uses shortcut keys (i.e alt+O , Alt+C).

How to write a code to find out if two keys are pressed at same time.

Thanks.
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the shortcut keys, check out the setMnemonic method of JButton:
 
Vijay Bhuruk
Ranch Hand
Posts: 31
MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!