I have a tabbedpane , which has 2 panes(panels), with following specifications:
First Pane - Registeration form and add record button , which is writing the new record into database.
Second Pane- Displays the datas in JTable
when i click to "add record" button the data is written in to the database , no problem , but when i switch to Second Pane , it displays the same old data. If I'm running the program again then the data is displayed .
I tried by placing a button in Second Panel "re-load table" , and handled it simply like this
whichi s also not working ....
Again changing the Model , will be complicated for me.
Changing the model is no more difficult than it is to create the model the first time. As Rob suggested above its a two step process:
a) create the model
b) use table.setModel( newlyCreatedModel );
Since you say the model alreaday displays data from the database you obvious know how to create a model. So its just a matter of adding a setModel() statement everytime you add a record on the first tab or select the second tab. The choice is up to you.