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

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 { }

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.49 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code provided in the image is a simple Java program that uses the Swing library to display a dialog box with a greeting message Hello and an image loaded from a given URL Before modifying the code ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!