使用 MigLayout 时,“add”的第三个 int 参数将如何影响布局?
例如:
layeredPane.setLayout(new MigLayout());
layeredPane.add(component, "pos 50 50, width 100, height 100", 0);
本例中的 0
确实会影响组件的分层,但我似乎无法弄清楚到底是如何影响的。我想覆盖组件,但由于 MigLayout
有第二个布局约束,我无法像往常一样将分层和定位与 JLayeredPane
结合起来。谢谢
For example:
layeredPane.setLayout(new MigLayout());
layeredPane.add(component, "pos 50 50, width 100, height 100", 0);
The 0
in this case does affect the component's layering, but I can't seem to figure out exactly how. I would like to overlay components, but because there is the second layout constraint for the MigLayout
, I can't combine layering and positioning as usual with a JLayeredPane
. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JLayeredPane 尚未实现
LayoutManager
然后你必须 setBounds 或 setSize默认情况下,构造函数中的第一个参数用于 JComponents,第二个参数用于层类型,JLayeredPane haven't got implemented
LayoutManager
then there you have to setBounds or setSize by default, first parameter in constructor is used forJComponents
, second for Type of Layer,