ClickableRandomStrings

ClickableRandomStrings - super.init();...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* The RandomStrings applet on which this applet is based shows randomly colored and positioned copies of a message in several randomly chosen fonts. This applet extends that one so that when the user clicks on the applet, it is redrawn (with new random choices). */ * import java.awt.*; import java.awt.event.*; i public class ClickableRandomStrings extends RandomStrings implements MouseListener { public void init() { // When the applet is created, do the initialization // of the superclass, RandomStrings. Then set this // applet to listen for mouse events on itself.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: super.init(); addMouseListener(this); } public void mousePressed(MouseEvent evt) { // When user presses the mouse, tell the system to // call the applet's paint() method. repaint(); } public void mouseEntered(MouseEvent evt) { } // These empty routines public void mouseExited(MouseEvent evt) { } // are required by the public void mouseClicked(MouseEvent evt) { } // MouseListener interface. public void mouseReleased(MouseEvent evt) { } } // end class ClickableRandomStrings...
View Full Document

This note was uploaded on 01/15/2010 for the course CSC 115 taught by Professor Jackson during the Spring '09 term at University of Victoria.

Ask a homework question - tutors are online