|
![]() |
名片设计 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菜单按钮的代码片段"相关的教程: · 一些无聊的代码之一:JAVA中的日期计算 · 轻量级的代码生成方案选择 · 关于JAVA中连接各类数据库的代码及其补充说明 · swt tray demo:右键菜单,单击隐藏,所有事件的例子 · [Eclipse笔记]Just for fun ? 在Eclipse下编译和运行C#的代码 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |