GUI Components
An Introduction
Prof. David Bernstein
James Madison University
Computer Science Department
bernstdh@jmu.edu
What is a GUI Component?
To a User:
A View (in the M-V-C)
To a Developer:
A Model
A Controller
Abstract Components
Model:
N/A
View:
Colors, fonts, ...
Controller:
hasFocus, isEnabled, ...
Buttons
Model:
Labels, icons
View:
Controller:
MouseDown, MouseUp
MouseOver, MouseOut, KeyPressed
Checkboxes/Radiobuttons
Model:
Labels, icons, isSelected
View:
Controller:
MouseClick
Listboxes/Comboboxes
Model:
Alternatives, selectedItems
View:
Controller:
MouseClick, KeyPressed
Sliders
Model:
lowerBound, upperBound, value
View:
Controller:
MouseDrag
Scrollbars
Model:
Same as for sliders
View:
Controller:
MouseDrag, MouseClick
Textfields/TextAreas
Model:
See the discussion of the M-V-C
View:
See the discussion of the M-V-C
Controller:
See the discussion of the M-V-C
There's Always More to Learn