CPS406/606 Class examples, Lecture 3 Java, Fall 99
Examples for Homework 1
Rational numbers - Assignment 2 1998
Rational numbers, second example 1998
Graphics and Applets
Demonstrate execution of Applet methods
Source
and
html file
for Graphics2D example. Compile and view with appletviewer from JDK1.2.
Digital Clock
Moving Rectangles
Drawing an Image
More Moving Objects
Geometry Examples with subclasses of Polygon
AWT and Events
Labels
Buttons
TextFields
TextAreas
Checkboxes
Checkboxes with a CheckboxGroup,
sometimes called radio buttons
Choice,
sometimes called menus
Lists of items,
with single selection
Lists of items,
with dynamic content and multiple selection
BorderLayouts
Scrollbars
Move Shapes with Mouse Events
Same example with adapter classes
Same example with inner classes
FlowLayouts
GridLayouts
CardLayouts
GridBagLayouts (and a simple Frame )
Hierarchical Layout with Buttons and Canvas - the three buttons
Another Hierarchical Layout with Buttons and Canvas - the bouncing ball
A CFD example
Simple Frame with WindowClosing
Swing Basic Components - Compile and view with appletviewer of JDK1.2
JButtons
JLabels
JTextFields
JTextAreas
JCheckboxes
JComboBoxes
JLists with single selections
JLists with multiple selections, add and remove elements
JScrollbar
Swing Components Overview
from the Sun tutorial.
Additional swing examples found on carver from the JDK1.2 installation in directory: /usr/npac/jdk1.2/demo/jfc/SwingSet