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
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));
}
}
Step by Step Solution
3.46 Rating (178 Votes )
There are 3 Steps involved in it
Heres an example of how you might create a Java program that displays a message dialog with plain te... View full answer
Get step-by-step solutions from verified subject matter experts
