October 2011
Beginner
432 pages
10h 18m
English
paint() MethodAn applet’s paint() method is executed when the applet window needs to be updated. You can also manually call the paint() method within an applet.
Calling repaint() forces the paint() method to be called. This statement tells the GUI that something has happened to make a display update necessary.
The LinkRotator applet has a short paint() method:
public void paint(Graphics screen) { Graphics2D screen2D = (Graphics2D) screen; screen2D.setColor(butterscotch); screen2D.fillRect(0, 0, getSize().width, getSize().height); screen2D.setColor(Color.black); screen2D.drawString(pageTitle[current], 5, 60); screen2D.drawString("" + pageLink[current], 5, 80);}
The first statement in this method ...
Read now
Unlock full access