Home | Articles

JFC Programming Quiz

Swinging Duke This short quiz tests your knowledge of the Swing and Accessibility APIs, which are part of the Java Foundation Classes (JFC). If you do not know an answer, take your best guess.

1. Which APIs comprise the Java Foundation Classes (JFC)?

Option Description
 A. JNI, JavaBeans, and Swing Components.
 B. Collections, extensions, and Swing Components.
 C. Java 2D, Drag-and-Drop, Accessibility, and Swing Components.
 D. Drag and Drop, Collections, Swing Components, and Accessibility.

2. What are assistive technologies?

Option Description
 A. GUI builders and Code generators.
 B. JavaStudioTM and Java Workshop.
 C. Screen readers, screen magnifiers, and speech recognition systems.
 D. Software to assist in the design review process.

3. The Java Accessibility API defines a contract between individual user-interface components that make up a Java application and an assistive technology that provides access to that application. Which interface must all components that support the Accessibility API implement?

Option Description
 A. AccessibleComponent.
 B. Accessible.
 C. AccessibleLayout.
 D. AccessibleContext.

4. Which interface allows an assistive technology to determine and modify the currently selected components in a user interface?

Option Description
 A. AccessibleSelection.
 B. AccessibleText.
 C. AccessibleValue.
 D. AccessibleAction.

5. Swing lets you develop lean and efficient GUI components with the look and feel you specify for your applications. Which look and feel looks the same on all platforms?

Option Description
 A. UNIX look and feel.
 B. Windows look and feel.
 C. Java look and feel.
 D. Custom look and feel.

6. All Swing components inherit a generic border property that can be customized for various plain or decorative borders. There are border classes that provide beveled borders for buttons, labeled borders for panels, and borders that are just simple lines. Which one of the following is a standard Swing border?

Option Description
 A. ImageBorder.
 B. MediaBorder.
 C. InsetBorder.
 D. MatteBorder.

7. Which Swing component lets you draw hierarchical data?

Option Description
 A. JTree.
 B. JApplet.
 C. JList
 D. JFileChooser.

8. Which Swing components are not lightweight?

Option Description
 A. JTree, JColorChooser, and JList.
 B. JWindow, JFrame, JDialog, and JApplet.
 C. JDialog, JDesktopIcon, and JInternalFrame.
 D. JMenuBar, JMenu, and JPopupMenu.

9. Which statement is true?

Option Description
 A. A lightweight component can have transparent pixels, and a heavyweight component is always opaque.
 B. A lightweight component can only be rectangular.
 C. A mouse event on a heavyweight component falls through to its parent.
 D. When a lightweight and heavyweight component overlap, the lightweight component is always on top.

10. Swing has which two kinds of classes?

Option Description
 A. Text and button classes.
 B. Event and model classes.
 C. AWT and Swing classes.
 D. UI and non-UI classes.

© 1994-2005 Sun Microsystems, Inc.