Section 16.4. Slow, Slow, Quick-Quick, Slow: The Basic Swing Objects


16.4. Slow, Slow, Quick-Quick, Slow: The Basic Swing Objects

Let's take a quick look at a variety of Swing objects that you can use to build a GUI. Like any job of craftsmanship, it helps to be familiar with your tools. What you can build will be aided (and limited) by the tools with which you build, and by how familiar you are with them. Here are some pieces which can be put together to make Swing GUIs:

button

A push button to trigger actions; can contain text and/or an icon.

radio button

A group of buttons where only one value can be chosen at a time.

check box

A choice of one or many of a small set of options.

combo box

A pull-down list of choices.

menu

A special case of a pull-down choice, a part of the border of a main window.

label

A small amount of text, typically used to label other controls.

text field

A simple display and/or entry of one line of text; think "fill-in-the-blank" kinds of forms, password entry, and the like.

text area

A multiline display and/or entry of text, all in a single font format.

text pane

Same as text area, plus multifont support, image display, and more; really more like a word processor in a window.

list

Selection from a list.

table

A two-dimensional displayrows and columns of data.

tree

A display of hierarchically-structured data.

slider

A graphical control for selecting a value.

tool tip

A bit of text that appears over objects when the mouse hovers.

progress bar

A graphical display of progress.

color chooser

A control for selecting colors from a palette.

file chooser

A window for interacting with the filesystemselecting a directory or a filename.

In addition to all these, there are various kinds of containersobjects whose job is to hold and display the other objects:

panel

A simple container.

split pane

A container divided into 2 separate parts.

scroll pane

A complex control with scrollbars, used to hold objects larger than the displayable area.

tabbed pane

A complex control with tab buttons to select different panels.

toolbar

A container for holding objects (usually buttons) which can attach to different sides of a window, or separate from a window and stand alone.



    Java Application Development with Linux
    Java Application Development on Linux
    ISBN: 013143697X
    EAN: 2147483647
    Year: 2004
    Pages: 292

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