Java Reference
In-Depth Information
2. Which user interface component is common in software installation programs?
a. Sliders
b. Progress bars
c. Dialog boxes
3. Which Java class library includes a class for clickable buttons?
a. Abstract Windowing Toolkit
b. Swing
c. Both
Answers
1. c. If you want to use a look and feel other than Metal, you must explicitly establish
that look and feel using a method of the javax.swing.UIManager class.
2. b. Progress bars are useful when used to display the progress of a file-copying or
file-extracting activity.
3. c. Swing duplicates all the simple user interface components included in the
Abstract Windowing Toolkit.
Certification Practice
The following question is the kind of thing you could expect to be asked on a Java pro-
gramming certification test. Answer it without looking at today's material or using the
Java compiler to test the code.
Given:
import java.awt.*;
import javax.swing.*;
public class AskFrame extends JFrame {
public AskFrame() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JSlider value = new JSlider(0, 255, 100);
add(value);
setSize(450, 150);
setVisible(true);
super();
}
public static void main(String[] arguments) {
AskFrame af = new AskFrame();
}
}
Search WWH ::




Custom Search