Type in and run the following program. Then modify it to show a different greeting and image.

Question:

Type in and run the following program. Then modify it to show a different greeting and image.

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(
"http://horstmann.com/java4everyone/duke.gif");
JOptionPane.showMessageDialog(null, "Hello", "Title",
JOptionPane.PLAIN_MESSAGE, new ImageIcon(imageLocation));
}
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: