Sample Programs for Class 3
Several sample programs are provided relating to the material
covered in class 3. Click here to
download the zip file containing these programs.
Panel1.java
The Panel1 program demonstrates simple user controls with a
default layout manager.
Compile (javac Panel1.java)
Execute - applet panel1.html
View Source
Panel2.java
The Panel2 program demonstrates more complex user controls and
some of the other layout manager types. To use it:
Compile - javac Panel2.java
Execute - applet panel2.html
View Source
Panel3.java
The Panel3 demonstrates construction and use of menus,
frames and card layout. To use it:
Compile - javac Panel3.java
Execute - applet panel3.html
View Source
Event1.java
The Event1 demonstrates mouse movement events. To use it:
Compile - javac Event1.java
Execute - applet event1.html
View Source
Event2.java
The Event2 demonstrates mouse drag events. To use it:
Compile - javac Event2.java
Execute - applet event2.html
View Source