Write a GUI that will let the user sample icons. It should have a menu named Icons that offers three choices: Smiley Face, Duke Waving, and Duke Standing. When the user chooses a menu item, the corresponding icon is displayed (and no other icons are displayed). When the GUI is first displayed, no icons are visible. The picture files for these icons are available in the source code for this chapter on the Web.

The layout of the window, structure of the code, and technique for updating the display based on the user’s selection is similar to that for MemoGUI, Listing 15.1. As with any of the applications that use icons, you will need to make sure that the image files are in an appropriate folder. This is not always the same as where the source files are located.


See the code in IconMenu.java.

Computer Science & Information Technology

You might also like to view...

The worst-case complexity function is a good measure to use when

A) the load on the system is heaviest B) we want a guarantee on the performance of an algorithm C) the best-case complexity would lead to incorrect results D) we want to create an efficient algorithm

Computer Science & Information Technology

If 3 “people” were listed in the queue, what would line.empty() do?

A. Clear the queue. B. Return true. C. Return false. D. That is not a function in the queue class.

Computer Science & Information Technology

The flowchart in the accompanying figure depicts a ____.

A. single-outcome selection B. Case structure C. dual-outcome selection D. if structure

Computer Science & Information Technology

What type of OS in firmware is designed to manage a specific device like a video game console?

A. network OS B. client OS C. workstation OS D. appliance OS

Computer Science & Information Technology