使用 MigLayout 时,“add”的第三个 int 参数将如何影响布局?

发布于 2024-12-27 04:52:17 字数 293 浏览 4 评论 0原文

例如:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日记撕了你也走了 2025-01-03 04:52:17

JLayeredPane 尚未实现 LayoutManager 然后你必须 setBoundssetSize默认情况下,构造函数中的第一个参数用于 JComponents,第二个参数用于层类型,

JLayeredPane haven't got implemented LayoutManager then there you have to setBounds or setSize by default, first parameter in constructor is used for JComponents, second for Type of Layer,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文