I have a fairly simple question. I have a JPanel on a JFrame. I have a JLabel on the JPanel. How, I wonder, do i FULLY REMOVE the JLabel from the JPanel during runtime?
ImageIcon image7= new ImageIcon("archmageanim.gif");
JLabel label7 = new JLabel("", image7, JLabel.CENTER);
p.add( label7, "0 , 6" ); //This coordinate has to do with a layout manager I'm using - it
//I'm using - it works fine.
I have looked for this solution…but everyone says “the easiest way” is to set setVisible(false)…but that doesn’t truly remove the object -_-. How can I REMOVE it?
Can’t you just use this to find the parent Container of the JLabel and then use the remove method?
That should remove the label altogether and then refresh the parent Container.