Eclipse Swing WindowBuilder尝试设置边框时返回错误 [英] Eclipse Swing WindowBuilder returns error when trying to set border
问题描述
我遇到Eclipse的Swing WindowBuilder的问题。
I'm encountering a problem with Eclipse's Swing WindowBuilder.
当我点击边框选项按钮来编辑jPanel的边框:
When I click on the border options button to edit the border of the jPanel:
我收到以下错误:
我在Mac OS X 10.8.4上运行。使用以下Eclipse版本和WindowBuilder版本。
I am running on Mac OS X 10.8.4. With the following Eclipse version, and WindowBuilder version.
推荐答案
WindowBuilder有很多很多问题。看起来你发现其中一个。
我没有试图使用与您相同的方法设置边框,即使我正在使用与您相同版本的eclipse。
WindowBuilder has many, many, many problems. It looks like you've found one of them. I had no problems trying to set the border using the same method as you, even though I am using the same version of eclipse as you.
解决方法:
Workaround:
要添加边框,请尝试切换到代码视图并更改:
contentPane.setBorder(new EmptyBorder(5,5,5,5));
To add a border, try switching to the code view and changing:
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
To:
JBorder myBorder = BorderFactory.createLineBorder(Color.black);
contentPane.setBorder(myBorder);
查看 http://docs.oracle.com/javase/tutorial/uiswing/components/border.html 和 http://docs.oracle.com/javase/7/docs/api/javax /swing/BorderFactory.html 有关创建边界的更多信息。
Check out http://docs.oracle.com/javase/tutorial/uiswing/components/border.html and http://docs.oracle.com/javase/7/docs/api/javax/swing/BorderFactory.html for more information on creating borders.
这篇关于Eclipse Swing WindowBuilder尝试设置边框时返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!