JTable将不显示列标题
我有以下代码实例化一个JTable:该表具有正确数量的行和列,但是在列顶部没有标题的迹象。 public Panel1() { int nmbrRows; setLayout(null); setBackground(Color.magenta); Vector colHdrs; //create column headers colHdrs = new Vector(10); colHdrs.addElement(new String("Ticker")); // more statements like the above to establish all col. titles nmbrRows = 25; DefaultTableModel tblModel = new DefaultTableModel(nmbrRows, colHdrs.size()); tblModel.setColumnIdentifiers(colHdrs); scrTbl = new JTable(tblModel); scrTbl.setBounds(25, 50, 950, 600); scrTbl.setBackground(Color.gray); scrTbl.setRowHeight(23); …