Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试添加一个 JButton,但它与进度条水平对齐。如何在下面的行中对齐 JButton? 另外,我正在尝试将所有组件分组到不同的组中,但我不知道该怎么做。有人知道吗?
对于 a 的简单拆分,JFrame您可以使用GridLayout具有 2 行和 2 列的 a。
JFrame
GridLayout
frame.setLayout(new GridLayout(2,2,3,3)); //3,3 are gaps frame.add(grid); //add components here...