CS 116
Sept. 9, 2002
Lesson3.java
from the class home page.
Identify all the local and instance variables. Hint: There are three
instance
variables and one local variable.
Lesson3
and run the applet. Try resizing
the applet. What happened and why?
Colors
class and notice all
the class variables like yellow
. How do we know that they are class
variables? Look at how the color yellow is used in the init()
method. See if you can figure out by looking at the documentation for the
TextField
class how to change the colors of the TextField
s.
Try it out.
paintText
variable to be a local variable in the
paint()
method rather than an instance variable. What happens when
you compile your program and why?