简体   繁体   中英

refreshing the data retrieved from database

I have a JFrame with a JTabbedPane.

In one of those panes, say compose , I save some new data in table. The other pane, say drafts , displays the saved data in the same table.

When you first login, the data saved in previous run of application is displayed in the drafts but if during the same run I save some new data from compose and then switch to draft pane, the data retrieved from the database doesnt have the new saved data.

In other words how can I refresh the data retrieved?

When you update a JComponent, it needs to be told to reload. So whenever you make the call to update your draft pane's data, you should also call draft.revalidate() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM