Java: Transposing a SpringLayout



我有一个需要转置的SpringLayout

基本上,当你创建一个SpringLayout时,它会按列填充面板,所以如果你有

JPanel temp = new JPanel()
retCase2.add(label = new JLabel("A"));
retCase2.add(label = new JLabel("B"));
retCase2.add(label = new JLabel("C"));
retCase2.add(label = new JLabel("D"));
Utils.makeCompactGrid(retCase2,
2, 2, //rows, cols
1, 1,        //initX, initY
10, 10);  
结果是一个表,看起来像这样:
A B
C D

但是,我想要

A C
B D

有人知道怎么做吗?

只要改变"b"one_answers"c"

最新更新