Scrollbars
Almost without doubt and before you
know it, your users will be filling your application with more
data than it can possibly display on one screen.
When this occurs, most programmers rely
on some form of scrolling control to allow the user to
manipulate the currently viewable portion of an interface
object. Scrolling is handled in the JDK by the Scrollbar
class. Scrollbars take a little more coding than is
realistic for this tutorial. However, you can certainly
consult the online documentation and any one of the 200 zillion
books on Java for more info.
Buttons
Buttons are probably the most common
interface control in modern user interfaces. They appear in
toolbars, in menus, as the up and down arrows in scrollbars,
and in all sorts of other places. In fact, it is hard to imagine
any interface without a button somewhere.
The Button class defines a standard
push button that uses 3D effects. When the user clicks on the
button with the mouse, the button visually depresses and then
pops back up when the mouse button is released.
We have already seen plenty of examples
of Buttons and Button code so we won't duplicate it here.
Canvases
Finally, the Canvas class prepares an
area upon which you can draw. We will discuss drawing later.
So for now, we will just mention this component.
BACK
Selena Sol contributes to the JavaBoutique's Introduction to Java. Selena currently works for Barclays Capital in London, one of the leading global investment banks in Europe and has worked as a software developer for the National Center for Human Genome research, Microline Software, Neuron Data, and Electric Eye in Singapore. Selena is perhaps best-known for creating the Public Domain Web Script Archive (Extropia) and writing several books on Web Programming (Perl, CGI, Java).
Email: selena@extropia.com
|