【发布时间】:2015-01-21 13:51:20
【问题描述】:
我已经为此工作了一段时间,但我这辈子什么也做不了。我正在尝试将按钮和标签设置为彼此叠加而不是并排设置。我想我必须将布局表单 FlowLayout 更改为 BoxLayout 但我不知道该怎么做。这是我目前所拥有的。
import javax.swing.JFrame;
public class VoteCounter
{
//----------------------------------------------
// Creates the main program frame.
//----------------------------------------------
public static void main(String[] args)
{
JFrame frame = new JFrame("Vote Counter");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new VoteCounterPanel());
frame.pack();
frame.setVisible(true);
}
}
任何帮助将不胜感激。
【问题讨论】:
标签: java swing layout-manager boxlayout flowlayout