I am creating a JDBC application, which the user interface consists of 2 tabs. First tab is to insert data, second is to update. When the user click on the second tab, I need to execute the method “getUpdates()”. I need to execute this method each time that the user navigates to this second tab. How can I do it?
(For more information, these two tabs are separate Java beans, which extends the class “Common GUI”. “Common GUI” extends from JPanel. They get displayed in class “Main GUI”, as tabs)
Please help!
If you are using
JTabbedPanethen you could useJTabbedPane#addChangeListeneras seen in this example