JButton home = new JButton("");
home.setBounds(506, 45, 27, 25);
// 没有边框
home.setBorder(null);
// 不填充
home.setContentAreaFilled(false);
home.setMargin(new Insets(0, 0, 0, 0));home.setIcon(new ImageIcon(
"D:\\logon\\ie\\a.png"));
home.setRolloverIcon(new ImageIcon(
"D:\\logon\\ie\\a_onclick.png"));
panel.add(home);然后我把这个添加到Panel中,当鼠标滑过按钮时,图片变化了,
可是按钮上显示的图片有白色的方块,或者说图片不能正常显示出来