图像需要指定详细路径。private JButton button =new JButton(new ImageIcon("images.gif"));
修改成
private JButton button =new JButton(new ImageIcon("c:\\images.gif"));就可以了。
修改成
private JButton button =new JButton(new ImageIcon("c:\\images.gif"));就可以了。
是可以的你先用一个小一点的图片试试
即在同一个文件夹下.
应该没问题的!