WindowBuilder 不允许 JPanel 中的所有布局
当我转到 JPanel 的属性时,无法将布局设置为 SpringLayout 或 FormLayout。这是 Java Swing 或 WindowBuilder 的限制吗?如果 SpringLayout 不可用,那么在 JPanel 内拥有一个大面板和一列较小组件的最佳方法是什么?
When I go to Properties of a JPanel, I can't set the Layout to SpringLayout or FormLayout. Is this a limitation of Java Swing or WindowBuilder? If SpringLayout is not available, what would be the best way to have one large panel, and column of smaller components, inside a JPanel?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我从未使用过 WindowBuilder(您是指 eclipse 中的那个吗?)。
对我来说最简单的似乎是
BorderLayout
,其中大面板位于CENTER
中。然后在WEST
或EAST
约束中添加一个JPanel
,可能还有一个BoxLayout
。I've never used WindowBuilder (do you mean the one from eclipse?).
The simplest to me seems to be a
BorderLayout
with your big panel in theCENTER
. Then an additionalJPanel
in either theWEST
orEAST
constraint with maybe aBoxLayout
.SpringLayout 和 (JGoodies) FormLayout 在 WindowBuilder 中都可用,因此这不是 WindowBuilder 的限制。请参阅文档...
http://code.google.com/ javadevtools/wbpro/layoutmanagers/swing/springlayout.html
http://code.google.com/javadevtools/wbpro/layoutmanagers/swing/ jgoodies_formlayout.html
您可以看到它们都列在布局面板中...
Both SpringLayout and (JGoodies) FormLayout are available in WindowBuilder, so this is not a limitation of WindowBuilder. See the docs...
http://code.google.com/javadevtools/wbpro/layoutmanagers/swing/springlayout.html
http://code.google.com/javadevtools/wbpro/layoutmanagers/swing/jgoodies_formlayout.html
You can see both of them listed right in the Layouts palette...