Hey I don't have enough knowledge on JTables, How to insert data in JTables by the way I entered the data in my table but I don't know why the column names not appear in my table.
Here's my code:
public class tab {
    public tab() {
        initComponents();
    }
    public void initComponents() {
        JFrame fr = new JFrame("Score Card");
        JScrollPane pane = new JScrollPane();
        fr.setSize(500, 350);
        JTable scoreTab = new JTable(5, 4);
        DefaultTableModel model = new DefaultTableModel(1, 4);
        // model.setColumnIdentifiers(new Object[]{"No","Name","Score","Date"});
        scoreTab.setModel(new javax.swing.table.DefaultTableModel(
        new Object[][] { { 1, 2, 2 },
        }, new String[] { "Name", "Score", "Date" }));
        pane.setViewportView(scoreTab);
        fr.add(scoreTab);
        fr.setLocationRelativeTo(null);
        fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        fr.setVisible(true);
    }
    public static void main(String[] args) {
        new tab();
    }
}
 
     
    