您的位置:首页 > 产品设计 > UI/UE

使用WindowsBuilder进行可视化设计时不能预览界面

2015-08-01 15:56 459 查看
今天用windowsBuilder设计界面,本来想自己写代码,然后再在可视化窗口中预览,看看效果,可是提示"WindowBuilder was not able to show the
GUI”的错误。google了一下,发现原来是布局不对造成的:

I tried creating a very simple project in which I created a layout manager named SomeLayout.
I copied into it the exact code from FillLayout, and I also created a SomeLayoutInfo class with helper classes, which I modeled exactly after the FillLayoutInfo and associated from the WB source tree. It doesn't seem to be working the way I expected. I have
attached a very simple sample Eclipse project that highlights the problem that I am seeing (note that the classpath will need to be massaged a bit to point to your local SWT version and WB installation directory).

In the sample project I have psoted, when I click on the Design tab for MainWindow.java, I get
a "WindowBuilder was not able to show the GUI" message. If I comment out line 47:

Code: [Select all] [Show/ hide]
// shell.setLayout(new SomeLayout(SWT.HORIZONTAL));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: