i would need same help, i don't understand why this is not working
what i'm trying to do is to make a small slideshow. i searched the web and i saw that this it should be done... my problem is that the JLabel that should contain an ImageIcon doesn't load at all and when i insert an image from folder it also doesn't load
i appreciate any help:D
public class Slide {
public static JButton button;
public static JLabel label;
public static ImageIcon img1, img2, img3;
public static JFrame frame;
public static void main(String args[]) {
button = new JButton("Click!");
img1 = new ImageIcon("http://calindragan.files.wordpress.com/2010/06/pictura_muzica.jpg");
label = new JLabel(img1);
//label.setIcon(img1);
//label.setSize(100, 100);
frame = new JFrame("Slide");
frame.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 20));
JFrame.setDefaultLookAndFeelDecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(450, 420);
frame.setVisible(true);
frame.add(label);
//frame.add(new JLabel(img1));
frame.add(button);
}
}