Why removeAll() is required in ListCellRenderer?
问题 This is my code:- public class MyRender extends JPanel implements ListCellRenderer { ImageIcon on_img; JLabel name = new JLabel(); JLabel icn = new JLabel(); JLabel img = new JLabel(); public MyRender(Atalk) { setOpaque(true); setBackground(Color.WHITE); setForeground(Color.black); on_img = new ImageIcon(MyCls.class.getClassLoader().getResource("imgPath")); } @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)