我有一個相當簡單的問題。我在JFrame上有一個JPanel。我在JPanel上有一個JLabel。我如何,我是否在運行時從JPanel完全刪除JLabel?從JPanel完全刪除JLabel ... not setVisible(False)
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.
我已經看過了這種解決方案,但大家都說「最簡單的方法」是設置調用setVisible(假)......但是,這並不真正刪除對象-_-。我如何刪除它?