62,614
社区成员
发帖
与我相关
我的任务
分享
String columnName[] ={"入库编号","商品名称","单价","数量","单位","总额","供应商","入库去向","入库时间","车辆","司机","押运员"};
table = new JTable(){
public boolean isCellEditable(int row, int column) //重写了isCellEditable方法
{
return false;//表格不允许被编辑
}
};
dftm =(DefaultTableModel) table.getModel();
dftm.setColumnIdentifiers(columnName);//设置表头
scrollPane.setViewportView(table);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportBorder(new TitledBorder(UIManager
.getBorder("TitledBorder.border"),
"\u5F85\u6DFB\u52A0\u9879\u76EE\uFF1A", TitledBorder.LEADING,
TitledBorder.TOP, null, null));
GridBagConstraints gbc_scrollPane = new GridBagConstraints();
gbc_scrollPane.gridwidth = 4;
gbc_scrollPane.insets = new Insets(0, 0, 5, 5);
gbc_scrollPane.fill = GridBagConstraints.BOTH;
gbc_scrollPane.gridx = 1;
gbc_scrollPane.gridy = 1;
contentPane.add(scrollPane, gbc_scrollPane);
这个是border的 设置。。