DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Keyboard shortcut on MenuItem.
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2008
Question Keyboard shortcut on MenuItem. - 05-27-2008, 01:24 AM

Hi All,
I have set a keyboard shortcut on the menuitem, but its not working. I'm pasting the code below..just have a peep and tell me if there is something wrong.

MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Add Region" + "\tCtrl + R");
menuItem.setAccelerator(SWT.CONTROL | 'R');
menuItem.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
System.out.println("Add Region Selected");
}
});




Thanks & Regards
Jay.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can you use the keyboard to activate a JComboBox within a JTable without using F2 lisae Java 8 09-29-2009 03:35 PM
Shortcut image svdnstee Java 3 01-22-2009 07:48 AM
Keyboard shortcut to Cut/Copy/Paste current line in editor? mkjackson Eclipse 0 11-07-2008 07:43 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com