A classic java applet (2)

Source: Internet
Author: User

Next, the following is the main program of the APPLET:
Public class MyClock extends Applet implements Runnable
{
Static final int BACKGROUND = 0; // the serial number of the BACKGROUND image for Array use
Static final int LOGO = 1; // the serial number of the LOGO image for Array use
Static final String JAVEX = "bear"; // text displayed on the dial
Static final double MINSEC = 0.104719755; // The radian between the probe and second-pin on the dial (60)
Static final double HOUR = 0.523598776; // The radian of the HOUR hand on the dial (24)
Thread clockThread = null; // use the multi-Thread mechanism to continuously display images with another Thread
// Provides the default parameters. If no parameters are provided in the HTML file, use
Int width = 100;
Int height = 100;
Color bgColor = new Color (0, 0 );
Color faceColor = new Color (0, 0 );
Color sweepColor = new Color (255, 0, 0 );
Color minuteColor = new Color (192,192,192 );
Color hourColor = new Color (255,255,255 );
Color textColor = new Color (255,255,255 );
Color caseColor = new Color (0, 0 );
Color trimColor = new Color (192,192,192 );
String logoString = null;
Image images [] = new Image [2]; // Image of the background and LOGO
Boolean isPainted = false; // if the background and dial are drawn during the first loading, only the pointer is drawn when the painting is re-painted at other times.
// The center of the clock
Int x1, y1;
// Coordinates of the scale chart of the triangle at the top
Int xPoints [] = new int [3], yPoints [] = new int [3];

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.