CS 120
Instructor: Jeffrey Horn
BASIC JAVA -- Graphics
- Graphics in Java requires quite a bit of extra code to handle the setup
of the window, the flow of data to and from the window, the control that the
user and the operating system can exercise over the window, etc.
To keep the programming simple, we use the following two files, each with a
class in it: MyPanel.java and PanelApplication.java. You
will need to compile and run PanelApplication.java, but your actual graphics
code will go in MyPanel.java. So save both of these to the same
folder, open both in your program editor (i.e., text editor), add code to
MyPanel, compile, but then go to PanelApplication and choose the "run
Application" tool.
- A compressed folder with both files in
it.
- The files separately: