0
是否有任何簡單的方法將按鈕居中置於一行上,同時按鈕左側的加載指示器不移動按鈕本身?使用MigLayout將一個組件居中在包含另一個組件的行上
我希望按鈕始終居中,並且加載指示器(JLabel
)應該位於按鈕的正面。
This solution seems way too complicated and doesn't actually work for what I want to do.
我到目前爲止是這樣的:
setLayout(new MigLayout("align center center"));
add(_loadingIndicator, "center, split 2");
add(_applyButton, "center");
但中心2個部件在一起,使按鈕從來沒有真正的中心。