简体   繁体   English

在Java swing中定位按钮

[英]Positioning a button in java swing

在此处输入图片说明

Hello, 你好,

How can I move the button "Apply" in the right of that bottom panel without "absolute layout? 如何在没有“绝对布局”的情况下移动该底部面板右侧的“应用”按钮?

Specify FlowLayout.RIGHT for the panel holding the button, as shown here and here : 为按住按钮的面板指定FlowLayout.RIGHT ,如此此处所示:

JPanel p = new JPanel(new FlowLayout(FlowLayout.RIGHT));

Then add p to the SOUTH or PAGE_END area of a panel having BorderLayout . 然后将p添加到具有BorderLayout的面板的SOUTHPAGE_END区域中。

图片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM