Hi guys I'm having problems getting this little program to function properly.
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
public class Test
{
public static void main(String[] args) throws Exception
{
URL imageLocation = new URL("https://duke.dev.java.net/images/iconSized/duke.gif");
JOptionPane.showMessageDialog(null, "Hello", "Title",
JOptionPane.PLAIN_MESSAGE, new ImageIcon(imageLocation));
System.exit(0);
}
}
Expected result:
a dialog box with "hello" in it, and an image somewhere in the mix.
Current Result:
a dialog box with hello in it... No image!
Can someone tell me why is the URL object not working properly?
thank you very much.
-Zeek