30
Sep
To use double-buffering in your own applets, paste
method. Remember that paint() is called to draw the applet when it first appears on the screen. By clipping in the paint() method, you ve restricted painting to the clipping rectangle, and the region outside the clipping rectangle will always stay blank. The proper moment to clip in our applet is when a repaint() takes place, and the call to clipRect() fits nicely in update(). Another way to restrict painting to a given rectangle is by using the following form of the repaint() method in the run() method of the applet: repaint(70,90,130,110); This version of the repaint() method paints the area bounded by the arguments. Compile and run the double-buffered, clipped version of Broadway, and you ll see the difference immediately. Now, the next step is turning this solo boogie into a group dance! Previous Table of Contents Next
Note: If you are looking for good and quality webspace to host and run your java application check Actions java hosting services
