My main JFrame
content panel which is card layout and I have added many (say panel1
, panel2
) panel as card. I would like to update UI panel1
when something changes in panel2
.
How to update child (panel) of CardLayout
in Swing?
My main JFrame
content panel which is card layout and I have added many (say panel1
, panel2
) panel as card. I would like to update UI panel1
when something changes in panel2
.
How to update child (panel) of CardLayout
in Swing?
Maintain a reference to the target of what you want to change, and use some kind of callback function to detect the changes. Use the stored reference in the callback function. How you specifically implement this should be whatever makes most sense for your code... but what you are trying to do is a simple task.