用swing的JTable如何将数据库中的数据动态生成到表格中

用swing的JTable怎么将数据库中的数据动态生成到表格中
在一个窗口中建一个表格,然后将数据库中的数据动态的生成在表格中

Java code

public void recordFrame(final Connection conn) {
        this.setTitle("寝室财产管理系统1.0--收支记录");
    this.setSize(WIDTH, HEIGHT);
    this.setLocation(x, y);
    this.setBackground(Color.YELLOW);
    this.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            setVisible(false);
        }
    });
    this.setVisible(true);
    this.setResizable(false);
}



------解决方案--------------------
没看到图,LZ可参考下面的
http://blog.csdn.net/pascal_sunhong/article/details/586700
------解决方案--------------------
Java code

TableModel tModel = new AbstractTableModel() {
        //加入此方法,否则JTABLE无法正确判值的类型
    public Class getColumnClass(int column) {
        return java.lang.String.class;    
        }
}