如何在MigLayout中将按钮对齐到右侧

如何在MigLayout中将按钮对齐到右侧

本文介绍了如何在MigLayout中将按钮对齐到右侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Miglayout向面板添加一个按钮,并尽我所能,我无法将其转到面板的右端。它坚持要向左冲洗。奇怪的是,演示在一个例子上有点简短(它只在同一个面板上的其他按钮的上下文中显示。

I am adding a button to a panel using Miglayout, and try what I might, I cannot get it to go to the right end of the panel. It insists on going flush left. Oddly, the demo is kind of short on such on a example (it only shows it in the context of other buttons on the same panel.

我有一个像这样的面板:

I have a panel like this:

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

除了它总是坚持这样:

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


推荐答案

好的,我得到了答案(最后)。当添加包含按钮的面板时,添加gapbefore push的组件约束我一直在尝试,但仅限于按钮本身,而不是面板。

OK, I got the answer to this (finally). When adding the panel that contains the button add the component constraint of "gapbefore push." I had been trying that, but only on the button itself, not the panel.

这篇关于如何在MigLayout中将按钮对齐到右侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 01:00