Basic HTML version of Foils prepared Sept 21 1998

Foil 23 The default Update(Graphics g) Method

From Java Tutorial 98- 3: Graphics and the Abstract Windowing Toolkit NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken


This sets background color and initializes applet bounding rectangle to this color
  • public void update(Graphics g)
    • {
    • g.setColor(getBackground());
    • g.fillRect(0,0,getSize().width,getSize().height);
    • g.setColor(getForeground());
    • paint(g);
    • }
  • getBackground() and getForeground() are methods in component class
  • fillRect() is a method in Graphics class



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998