6、ent.*; import java.util.Vector; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; public class AddRemoveCells implements ActionListener { JTable table = null; DefaultTableModel defaultModel = null; public AddRemoveCe
7、lls() { JFrame f = new JFrame(); String[] name = {"字段 1","字段 2","字段 3","字段 4","字段 5"}; String[][] data = new String[5][5]; int value =1; for(int i=0; i
8、Of(value++); } defaultModel = new DefaultTableModel(data,name); table=new JTable(defaultModel); table.setPreferredScrollableViewportSize(new Dimension(400, 80)); JScrollPane s = new JScrollPan