正如您在此处看到的,我正确定义了我的变量,但是当我尝试运行一个方法时,一旦用户单击了 Jlabel 标签,它就不允许我在 lol 方法的参数中输入 Graphics g?为什么这是帮助!
ImageIcon icon = new ImageIcon(hut);
label.setIcon(icon);
label.addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e){
**lol(Graphics g);**
}
private void lol(Graphics g) {
System.out.print('\u000C');
storelook = new ImageIcon("/Users/alexspallone/Desktop/Programing/Pictures For Java/scroll.jpg").getImage();
g.drawImage(storelook,0,0,null);
}
});