Menu On Button Click [message #782767] |
Tue, 24 January 2012 07:03  |
Eclipse User |
|
|
|
Hi
I am new to SWT. How to show menu on the click of the button. I do not want to show on right click. I have below code which work for right click. How to make it to work on simple click.
final Button btnNewButton_1 = new Button(parent, SWT.NONE);
btnNewButton_1.setImage(img);
menu_1 = new Menu(btnNewButton_1);
btnNewButton_1.setMenu(menu_1);
mntmNewItem = new MenuItem(menu_1, SWT.NONE);
mntmNewItem.setText("New Item1");
mntmNewItem_1 = new MenuItem(menu_1, SWT.NONE);
mntmNewItem_1.setText("New Item2");
mntmNewItem_2 = new MenuItem(menu_1, SWT.NONE);
mntmNewItem_2.setText("New Item3");
btnNewButton_1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
}
});
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03328 seconds