如何清除 6x6“表”,以便清除其中的任何内容?(我已经用 ActionListener ...等制作了清除按钮)
//other code above that creates window, below is the code that creates the table I need to clear
square = new JTextField[s][s];
for (int r=0; r!=s; r++) {
symbols[r] = new JTextField();
symbols[r].setBounds(35+r*35, 40, 30, 25);
win.add(symbols[r], 0);
for (int c=0; c!=s; c++) {
square[r][c] = new JTextField();
square[r][c].setBounds(15+c*35, 110+r*30, 30, 25);
win.add(square[r][c], 0);
}
}
win.repaint();
}