【问题标题】:How do I get a button to align to the right in MigLayout如何让按钮在 MigLayout 中向右对齐
【发布时间】:2011-03-15 22:04:03
【问题描述】:

我正在使用 Miglayout 向面板添加一个按钮,并尝试了我可能的方法,但我无法让它转到面板的右端。它坚持向左冲洗。奇怪的是,该演示在示例中有点短(它仅在同一面板上的其他按钮的上下文中显示它。

我有一个这样的面板:

    dialog
      ->complex display retrieved from another class
                                               OK Button here.

除了它总是坚持这样说:

    dialog
      ->complex display retrieved from another class
    OK Button here.

【问题讨论】:

    标签: java swing miglayout


    【解决方案1】:

    好的,我(终于)得到了答案。添加包含按钮的面板时,添加“gapbefore push”的组件约束。我一直在尝试,但只在按钮本身上,而不是面板上。

    【讨论】:

      【解决方案2】:

      panel.add(button, "skip(the amount of cells you have), al 100%")

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-06-13
        • 2015-05-15
        • 2013-03-04
        • 2019-01-16
        • 2015-12-15
        • 1970-01-01
        • 2017-01-05
        • 2015-11-13
        相关资源
        最近更新 更多