I have a application that uses a JTable in it. when I add something to the database it comes into database but I am not able to recreate the JTable somehow.. I have tried to repaint(); the method that creates my table I have tried the Revalidate(); but also no success
I even tried to recall the method but also that didn't help.
The actionperformed is as follows:
    @Override
public void actionPerformed(ActionEvent e) {
    if(e.getSource() == add) {
        model.insertValue(toDo.getText());
        model.getValue();
        view.createTable();
        toDo.setText("");
    }
}
and the method that creates the JTable
    public void createTable() {
    JTable table = new JTable();
    DefaultTableModel tableModel = new DefaultTableModel(new Object[][]{},new String[]{"To do","Date added", "Modify"});
    table.setSize(450, 600);
    table.setModel(tableModel);
    JScrollPane scrlPan=new JScrollPane(table);
    for(int i = 0; i < model.getId().size(); i++) {
        tableModel.addRow(new Object[]{
                model.getItem().get(i), 
                model.getDate().get(i), 
                model.getId().get(i)
                });
    }
    add(scrlPan);
    add(table.getTableHeader(), BorderLayout.NORTH);
    add(table, BorderLayout.CENTER);
}
any ideas on how to solve this?
 
     
     
    