java setIcon用于JLabel时不工作
当我将背景色设置为null
时,使用setIcon
不起作用,尽管setText
仍然有效。这是什么原因?我该如何解决
public void actionPerformed(ActionEvent e) {
if(e.getSource()==arrowr){
Reset();
ImageIcon icon = new ImageIcon("queen.bmp");
b[1][1].setBackground(null);
b[1][1].setIcon(icon);
}
}
共 (0) 个答案