如题,SWT的ExpandBar当展开ExpandItem至出现竖直拖动条后,竖直拖动条不响应鼠标滚轮事件,Java代码如下:package com.trey.swt;import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ExpandBar;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.ExpandItem;public class ExpanelTest { protected Shell shell;
private ExpandBar expandBar;
private ExpandItem eItem300;
private ExpandItem eItem450;
private ExpandItem eItem600; /**
* Launch the application.
* @param args
*/
public static void main(String[] args) {
try {
ExpanelTest window = new ExpanelTest();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
} /**
* Open the window.
*/
public void open() {
Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} /**
* Create contents of the window.
*/
protected void createContents() {
shell = new Shell();
shell.setSize(450, 300);
shell.setText("SWT Application");
shell.setLayout(new FillLayout(SWT.HORIZONTAL));
expandBar = new ExpandBar(shell, SWT.BORDER | SWT.V_SCROLL);
eItem300 = new ExpandItem(expandBar, SWT.NONE);
eItem300.setText("\u9AD8\u5EA6300");
eItem300.setHeight(300);
eItem450 = new ExpandItem(expandBar, SWT.NONE);
eItem450.setText("\u9AD8\u5EA6450");
eItem450.setHeight(450);
eItem600 = new ExpandItem(expandBar, SWT.NONE);
eItem600.setText("\u9AD8\u5EA6600");
eItem600.setHeight(600);
}}
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ExpandBar;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.ExpandItem;public class ExpanelTest { protected Shell shell;
private ExpandBar expandBar;
private ExpandItem eItem300;
private ExpandItem eItem450;
private ExpandItem eItem600; /**
* Launch the application.
* @param args
*/
public static void main(String[] args) {
try {
ExpanelTest window = new ExpanelTest();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
} /**
* Open the window.
*/
public void open() {
Display display = Display.getDefault();
createContents();
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} /**
* Create contents of the window.
*/
protected void createContents() {
shell = new Shell();
shell.setSize(450, 300);
shell.setText("SWT Application");
shell.setLayout(new FillLayout(SWT.HORIZONTAL));
expandBar = new ExpandBar(shell, SWT.BORDER | SWT.V_SCROLL);
eItem300 = new ExpandItem(expandBar, SWT.NONE);
eItem300.setText("\u9AD8\u5EA6300");
eItem300.setHeight(300);
eItem450 = new ExpandItem(expandBar, SWT.NONE);
eItem450.setText("\u9AD8\u5EA6450");
eItem450.setHeight(450);
eItem600 = new ExpandItem(expandBar, SWT.NONE);
eItem600.setText("\u9AD8\u5EA6600");
eItem600.setHeight(600);
}}
解决方案 »
- myeclipse7.0调试出问题?
- 在spring+hibernate架构中,我的getHibernateTemplate()为什么不能把VO转换成PO?
- 某个本科毕业的毕业设计,请有能力的给个思路?拜托了
- Graphics如何改变矩形边框的颜色和矩形背景颜色
- java应用程序中怎么样得到
- 能否只用JAVA实现单机界面登陆验证(和本机数据库相连)?
- 请问有中文版的java帮助文件吗?
- 想用JAVA做一些小型的软件,都需要学习什么知识啊?看我列的几项行吗?谢谢!
- 服务器端通信
- 有谁知道 哪里可以找到关于正则表达式的相关介绍??多谢
- 序列化时出现Exception in thread "main" java.io.NotSerializableException: Customer错误
- 重载
但是我开发的方式和你不一样...我一般都是通过扩展点来加载view或者编辑器,除非必要,否则肯定不手动写代码加载
能响应风火轮滚动。
我是SWT3.6.0 Windows你是什么运行环境?