|
| |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
SWT制作下拉式toolbar菜单按钮的代码片段:final ToolItem dropdown = new ToolItem(bar, SWT.DROP_DOWN);dropdown.setText("Drop-down");//一个popoupMenufinal Menu menu = new Menu(shell, SWT.POP_UP);MenuItem choice = new MenuItem(menu, SWT.PUSH);choice.setText("Choices");dropdown.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { if (event.detail == SWT.ARROW) { Rectangle rect = dropdown.getBounds(); Point pt = new Point(rect.x, rect.y + rect.height); pt = bar.toDisplay(pt); menu.setLocation(pt.x, pt.y); menu.setVisible(true); } }}); 返回类别: 教程 上一教程: Flow control and exception Handling 下一教程: 配置一个cview真难 您可以阅读与"SWT制作下拉式toolbar菜单按钮的代码片段"相关的教程: · 利用静态内部类为您的代码添加辅助功能 · JSP+JAVASCRIPT打造二级级联下拉菜单 · swt tray demo:右键菜单,单击隐藏,所有事件的例子 · 自己写了一个imagebuffer 转 bmp 流的代码段,希望对大家有用。 · java Socket 通讯的代码例子 |
| 快精灵印艺坊 版权所有 |
首页 |
||