posted 13 years ago
Hi...! i have a problem in refreshing JPanels in cardlayout. I have used cardlayout and i displayed separate informations in different JPanels. Now selecting each JMenuItems from the menuBar displays separate JPanels.
I have used three classes for this.....
1) A class containing the connections and the database queries.....
2) One main class......
3) Separate separate classes for the JPanels (which are in cardlayout) and these JPanels are then added to the main class, which contains the cardlayout........
Again in each JPanels(in cardlayout) there are JLabels and Graphs containing database values. Now my problem is that when i select different menuItems it displays the required JPanels, but it leaves the previous JPanel in that state in which i left.....
Let me explain properly.... For example in one JPanel there is a combobox, having list of Temperature, Rainfall, Wind. Now at first it displays Temperature Graph and if i select Rainfall then it displays Rainfall Graph. Working fine.... Now if i select another JMenuItem then it takes me to the respective JPanel, but it leaves the JPanel in that state where i left i.e when i again select JMenuItem (for the JPanel) then i found the JPanel with the Rainfall Graph but i need the JPanel with the Temperature Graph..... i.e the JPanels must got refreshed at each switching (of JPanels), by selecting JMenuItem
Probably i could explain you properly..... I have tried to use swing timers, but still not any progress........ Please suggest me..... please guide me........ Please give some valuabe information...... Any help will highly be appreciated.... Thanks