How Do These Concepts Translate into Code?

Visual Index to Swing Components

Now that you've gotten a taste of how to build your own Swing programs, this section gives a quick, visual reference of the Swing components so you can find more information online and on the CD. The components are broken down into six categories: top-level containers, general-purpose containers, special-purpose containers, basic controls, uneditable information displays, and editable displays of formatted information.

Table 52. Top-Level Containers: The components at the top of any Swing containment hierarchy

Component

URLs

Applet

graphics/10icon08.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JApplet.html

Dialog

graphics/10icon09.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JDialog.html

Frame

graphics/10icon10.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JFrame.html

Table 53. General-Purpose Containers: Intermediate containers that can be used under many different circumstances

Component

URLs

Panels

graphics/10icon11.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/panel.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JPanel.html

Scroll Pane

graphics/10icon12.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JScrollPane.html

Split Pane

graphics/10icon13.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JSplitPane.html

Tabbed Pane

graphics/10icon14.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/tabbedpane.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTabbedPane.html

Tool Bar

graphics/10icon15.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/toolbar.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JToolBar.html

Table 54. Special-Purpose Containers: Intermediate containers that play specific roles in the UI

Components

URLs

Internal Frames

graphics/10icon16.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/internalframe.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JInternalFrame.html

Layered Panes

graphics/10icon17.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JLayeredPane.html

Root Pane (representation)

graphics/10icon18.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JRootPane.html

Table 55. Basic Controls: Atomic components that exist primarily to get input from the user and that generally also show simple state

Components

URLs

Buttons

graphics/10icon19.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/button.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JButton.html

Combo Box

graphics/10icon20.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JComboBox.html

List

graphics/10icon21.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/list.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JList.html

Menu

graphics/10icon22.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JMenu.html

Slider

graphics/10icon23.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JSlider.html

Text Fields

graphics/10icon24.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTextField.html

Table 56. Uneditable Information Displays: Atomic components that exist solely to give the user information

Components

URLs

Label

graphics/10icon25.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/label.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JLabel.html

Progress Bar

graphics/10icon26.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JProgressBar.html

Tool Tip

graphics/10icon27.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/tooltip.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JToolTip.html

Table 57. Editable Displays of Formatted Information: Atomic components that display highly formatted information that (if you choose) can be edited by the user

Components

URLs

Color Chooser

graphics/10icon28.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/colorchooser.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JColorChooser.html

File Chooser

graphics/10icon29.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JFileChooser.html

Table

graphics/10icon30.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTable.html

Text

graphics/10icon31.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/text/JTextComponent.html

Tree

graphics/10icon32.gif

The Java Tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

API Documentation:

http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTree.html

Getting Started

Object-Oriented Programming Concepts

Language Basics

Object Basics and Simple Data Objects

Classes and Inheritance

Interfaces and Packages

Handling Errors Using Exceptions

Threads: Doing Two or More Tasks at Once

I/O: Reading and Writing

User Interfaces That Swing

Appendix A. Common Problems and Their Solutions

Appendix B. Internet-Ready Applets

Appendix C. Collections

Appendix D. Deprecated Thread Methods

Appendix E. Reference



The Java Tutorial(c) A Short Course on the Basics
The Java Tutorial: A Short Course on the Basics, 4th Edition
ISBN: 0321334205
EAN: 2147483647
Year: 2002
Pages: 125

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net