26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

800 Graphical User Interface Components: Part 2 Chapter 13<br />

labels for tick marks setSelected method of AbstractBut<strong>to</strong>n<br />

last method of class CardLayout setTitle method of class Frame<br />

major tick mark setVerticalScrollBarPolicy method<br />

menu show method of class JPopupMenu<br />

menu bar snap-<strong>to</strong> ticks<br />

menu item submenu<br />

metal look-and-feel super.paintComponent( g );<br />

method setMnemonic of AbstractBut<strong>to</strong>n SwingConstants.HORIZONTAL<br />

minor tick mark SwingConstants.VERTICAL<br />

mnemonic thumb of a JSlider<br />

modal dialog tick mark<br />

modeless dialog UIManager class<br />

Motif look-and-feel UIManager.LookAndFeelInfo class<br />

multiple document interface (MDI) updateComponentTreeUI method<br />

next method of class CardLayout vertical strut<br />

paintComponent method of JComponent weightx variable of GridBagConstraints<br />

parent window weighty variable of GridBagConstraints<br />

pluggable look-and-feel (PLAF) windowActivated method<br />

previous method of class CardLayout windowClosed method<br />

scrollbar policies for a JScrollPane windowClosing method<br />

setConstraints method WindowConstants.DISPOSE_ON_CLOSE<br />

setDefaultCloseOperation method windowDeactivated method<br />

setHorizontalScrollBarPolicy methodwindowDeiconified method<br />

setJMenuBar method windowIconified method<br />

setLookAndFeel method WindowListener interface<br />

setMajorTickSpacing method windowOpened method<br />

setOpaque method of class JComponent Windows look-and-feel<br />

setPaintTicks method of class JSlider<br />

SELF-REVIEW EXERCISES<br />

13.1 Fill in the blanks in each of the following statements:<br />

a) The class is used <strong>to</strong> create a menu object.<br />

b) The method places a separa<strong>to</strong>r bar in a menu.<br />

c) Passing false <strong>to</strong> a TextArea’s<br />

ified by the user.<br />

method prevents its text from being mod-<br />

d) JSlider events are handled by the method of interface .<br />

e) The GridBagConstraints instance variable is set <strong>to</strong> CENTER by default.<br />

13.2 State whether each of the following is true or false. If false, explain why.<br />

a) When the programmer creates a JFrame, a minimum of one menu must be created and<br />

added <strong>to</strong> the JFrame.<br />

b) The variable fill belongs <strong>to</strong> the GridBagLayout class.<br />

c) JFrames and applets cannot be used <strong>to</strong>gether in the same program.<br />

d) The <strong>to</strong>p-left corner of a JFrame or applet has a coordinate of (0, 0).<br />

e) A JTextArea’s text is always read-only.<br />

f) Class JTextArea is a direct subclass of class Component.<br />

13.3<br />

g) The default layout for a Box is BoxLayout.<br />

Find the error(s) in each of the following and explain how <strong>to</strong> correct the error(s).<br />

a) JMenubar b;<br />

b) mySlider = JSlider( 1000, 222, 100, 450 );

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!