






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of java gui elements, including components (labels, text areas, buttons, etc.), containers (windows, menus, toolbars), layout (arrangement of widgets), and events (mouse clicks, keyboard input, menu selections). It also covers java gui classes (awt and swing), layout managers (gridlayout, borderlayout, cardlayout, gridbaglayout), and examples of creating jframe, jtextfield, jlabel, buttons, jlist, jcombobox, menus, panels, and dialog boxes.
Typology: Study notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!







1
2
3
GUI Elements – Component
Actual items (widgets) user sees in GUI
Labels (fixed text) Text areas (for entering text) Buttons Checkboxes Tables Menus Toolbars Etc…
4
GUI Elements – Container
Abstractions occupying space in GUI
Usually contain one or more widgets Can be nested in other containers
Window containing 1 menu (component) 3 buttons (component) 2 windows (container)
7
GUI Elements – Events
Action or condition occurring outside normal flow of control of program
Mouse clicks Keyboard input Menu selections Window actions
8
Java GUI Classes
Old GUI framework for Java (Java 1.1) Some reliance on native code counterparts Platform independence problems
New GUI framework first introduced in Java 1. Includes AWT features plus many enhancements Pure Java components (no reliance on native code) Pluggable look and feel architecture
9
JFrame Hierarchy
Several super classes and well as implemented interfaces
Many, many member methods including inherited methods that allow for operations such as resizing, setting properties, adding components, etc.
Other top level containers JDialog (dialog boxes) JApplet (web applets) JWindow (stripped down JFrame, no title bar or window buttons)
Object
Component
Container
Window
Frame
JFrame
10
Java GUI Components
Examples JFrame JTextfield Jlabel Button JList JComboBox Menu Combo
Panes Indicators Dialog boxes JFileChooser Color chooser JTable JTree
13
JFrame
14
JTextField and JLabel
15
Buttons
Toolbar
16
JList and JComboBox
19
Various Indicators
Spinner
Slider
Progress Bar
20
A Dialog Box
21
JFileChooser
22
Color Chooser