import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTable;
import java.awt.*;
import javax.swing.table.JTableHeader;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Frame1 extends JFrame {
JPanel contentPane;
String[] columnName = {"姓名", "年龄", "成绩"};
Object[][] tableValuse = { {"TT", new Integer(16), new Integer(80)}
};
JTable jTable1 = new JTable(tableValuse,columnName);
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(400, 300));
setTitle("Frame Title");
jTable1.setCellSelectionEnabled(true);
jTable1.setBounds(new Rectangle(52, 45, 298, 194));
contentPane.add(jTable1);
}
}
列标题为什么无法显示啊???