我的 Swing 应用程序的 GUI 是使用Window Builder Pro
GUI 编辑器构建的。使用的布局是MigLayout
和AbsoluteLayout
。应用程序是使用Windows
Machine 开发的,因此 UI 在 中对齐且整洁Windows
,但是当我在 中运行相同的应用程序时Mac OS X
,应用程序Frame
无法容纳其内部的组件bounds
。我的意思是,Components
框架内部的大小会随着平台的变化而变化。当我提供额外的空间(增加帧边界)时,它看起来不错,Mac
但在Windows
. 有没有什么办法可以拥有Frame
或Panel
增长它的内容或Components
.
问问题
128 次
2 回答
4
不要使用绝对布局。布局管理器精确地用于避免您面临的那种问题。
于 2012-01-31T08:24:01.580 回答
1
Assuming you used AbsoluteLayout
because none of the existing layout managers suited your needs,
Have a look at Creating a Custom Layout Manager and use one instead of AbsoluteLayout.(Before that make sure none of the present layout managers suit your need)
于 2012-01-31T08:32:50.883 回答