0

Since Visual Editor is no longer supported in newer versions of eclipse, I am trying to make the switch to WindowBuilder.

It seems that I should just be able to open a panel created in Visual Editor in WindowBuilder and all components should display, but this does not seem to be the case. All components sizes seem to come in as 0px x 0px and even after changing this, the components still do not show up in the preview window.

All components are custom that extend the standard JComponent (such as JLabel).

I am not sure if the problem is some sort of incompatibility, the fact that I am using custom components and containers, or a problem with my WindowBuilder installation (or something else!). Does anyone have any insight? I would be much appreciated! :)

4

3 回答 3

0

我发现有时在尝试使用 WindowBuilder 编辑器直接重新打开文件时,代码不能很好地传输。我发现创建一个与现有代码相同类型的新 WindowBuilder 文档,然后替换文件内容效果很好,如果您不介意不便的话。

于 2014-07-18T17:31:06.577 回答
0

在解决这个问题一段时间后,我发现了导致错误的原因。在解析代码以显示预览时,可视化编辑器似乎更加宽容。

我对 Window Builder 的问题通常源于以下几点:

  • 在要显示的面板/对话框和其中的组件中都缺少无参数的构造函数。WB 依赖这些构造函数来解析代码
  • 无法获取动态生成的资源,导致抛出空指针异常。可视化编辑器似乎忽略了这些并显示了它可以显示的内容。Window Builder 不会显示有问题的组件的任何部分。在某些地方添加空检查可以解决这个问题。

解决这些问题后,我不必在 Window Builder 中重新创建任何 GUI 屏幕

于 2014-08-14T13:34:20.233 回答
0

如果我正确理解您的问题,您所要做的就是右键单击包资源管理器中的类 > 打开方式 > WindowBuilder 编辑器

于 2014-05-14T21:10:40.107 回答