0
如何在同一個網格框中添加兩個標籤?例如在第1行中,第1列將是2個標籤? 下面的代碼將在兩個不同的網格中添加標籤。如何在一個網格框中添加兩個標籤?
JPanel chckBox = new JPanel(new GridLayout(1,8,3,3));
JLabel label1 = new JLabel("A");
JLabel label2 = new JLabel("B");
...
chckBox.add(label1);
chckBox.add(label2);
...