# 99 Extra
# 99 Extra
# Nasty Surprise
Make a user interface that has 2 buttons. One says “Trick” the other says “Treat”.
When the user clicks on the Trick button, show them a picture of a cute puppy.
When they click Treat, show them a scary image.
To show the pictures, use the showPictureFromTheInternet() method below.
private void showPictureFromTheInternet(String imageUrl) {
try {
URL url = new URL(imageUrl);
Icon icon = new ImageIcon(url);
JLabel imageLabel = new JLabel(icon);
JFrame frame = new JFrame();
frame.add(imageLabel);
frame.setVisible(true);
frame.pack();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}