I have a Frame class (extends JInternalFrame). Inside the class I am instantiating a JPanel and initializing setVisisble(false)
. After the user clicks a buttom in the frame and does some processing, I call a method inside of the JPanel to update one of its labels. I then do setVisible(true)
on the JPanel.
However, the JPanel is not "refreshing" correctly after I call setText()
on one of its labels. After the processing and setting the JPanel to visible (and I confirmed that the right data is there etc), the JPanel still is in its initialized form.
In other words, what do I need to do so that calling setText()
on a JPanel within a frame actually refreshes the Panel?
Basically i'm wondering: if you update the text of a label inside a swing component which is nested inside of a JFrame, should the update be visible? What needs to be done to refresh if not?