More Graphics Concepts
GUI Graphical User Interface vs CLI (Command Line Interface)
Layout Managers
- Flow
Layout-Displays components left to right
and then top to bottom
- Border
Layout-Displays components "north", "south",
"east", "west", or "center"
-
GridLayout-Displays
components in a "grid," with
each component justified so that it fills its space in
the grid.
Events, Handlers, and Listeners
- An event is something like: clicking the mouse, dragging,
choosing a menu item, or pressing a key on the keyboard. In
other words, an event is something that is intended to elicit
a response.
- A listener is an object that detects an event. (For
example, if you want to be able to click a button, that
button will be associated with a listener to detect when it
has been clicked.)
- A handler is a method that responds appropriately to
the event.
TextFields
Constructors
- TextField (int width) //empty textfield, with width columns
- TextField (String s) //textfield containing the string s
- TextField (String s, int width) //textfield with string s, width
//columns
Methods
- getText() //returns a string from the textfield
- setText() //puts the given string in the textfield
Click
here to return to IT 108 web page
Copyright © 1999, 2000 All Rights
Reserved