1

I have a Jtable that connect with View Table sql server , the jtable has Task mission details, for insert new data row I open new form (Action Insert Form). I Need to refresh data from Action Insert form to Parent form(Jtable). now this is my solution:

try 
{
            CheckFieldsBeforeInsert();
            ExecuteInsertQuery();
            closeAfterInsert();
}


private void closeAfterInsert() 
{
    TaskGui taskGui=new TaskGui(User.getUserRole());
    taskGui.setSize(1015,565);
    taskGui.setLocationRelativeTo(null);
    taskGui.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    taskGui.setResizable(false);
    TmpFrame.dispose();      //------>Parent form
    this.dispose();          //------>Action insert form 
    taskGui.setVisible(true);
}
  • 2
    So what's the problem? Update your JTable's model with the new data – StanislavL Jul 28 '15 at 14:40
  • 1) See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) 2) Instead use a [`CardLayout`](http://download.oracle.com/javase/8/docs/api/java/awt/CardLayout.html) as shown in [this answer](http://stackoverflow.com/a/5786005/418556). – Andrew Thompson Jul 28 '15 at 18:21

0 Answers0