動作映像はこちらです。

下記のソースはこちらのソースを参考にして作りました。

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Insets;
import java.awt.image.BufferStrategy;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.*;
import java.awt.Polygon;
import java.awt.Font;
import java.util.Random;

public class ColourfulClock {
JFrame frame1;
BufferStrategy bstrategy;
static final int winSizeX = 400;
static final int winSizeY=480;
static final int centerX = 203;
static final int centerY = 170;
static final int secHandLength1 = 130;
static final int minHandLength1 = 120;
static final int hourHandLength1 = 90;
static final int secHandLength2 = 30;
static final int minHandLength2 = 24;
static final int hourHandLength2 = 22;
static final int secHandLength3 = 100;
static final int minHandLength3 = 80;
static final int hourHandLength3 = 60;
static final int numPos = 140;
static final double DegrOf0h = Math.PI / 2.0; // 0時の角度(ラジアン)
static final double DegrOf1h = Math.PI / 3.0; // 1時の角度(ラジアン)
static final double DegrPerHour = Math.PI / 6.0; // 1時間あたりの角度(ラジアン)
static final double DegrPerMin = Math.PI / 30.0; // 1分あたりの角度(ラジアン)
static final double DegrPerSec = Math.PI / 30.0; // 1秒あたりの角度(ラジアン)

double theta = DegrOf0h;
double sec, min, hour, sec01, min01, hour01,sec02, min02, hour02,sec03, min03,
hour03,sec04, min04,
hour04,secAng, minAng, hourAng,secAng1, minAng1, hourAng1,secAng2, minAng2,
hourAng2,secAng3,
minAng3, hourAng3,secAng4, minAng4, hourAng4;

ColourfulClock(){
frame1 = new JFrame("Colourful Clock");
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setResizable(false);
frame1.setVisible(true);
Insets insets = frame1.getInsets();
frame1.setSize(winSizeX + insets.left + insets.right, winSizeY + insets.top +
insets.bottom);
frame1.setLocationRelativeTo(null);
frame1.setIgnoreRepaint(true);
frame1.createBufferStrategy(2);
bstrategy = frame1.getBufferStrategy();

Timer t = new Timer();
t.schedule(new MyTimerTask(),10, 1000);
}

public static void main(String[] args) {
new ColourfulClock();
}

class MyTimerTask extends TimerTask{
public void run(){
Graphics g = bstrategy.getDrawGraphics();
g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

Random rnd = new Random(); //一秒ごとに色を変えるために乱数を取得
int ran1 = rnd.nextInt(256);
int ran2 = rnd.nextInt(256);
int ran3 = rnd.nextInt(256);
int ran4 = rnd.nextInt(256);
int ran5 = rnd.nextInt(256);
int ran6 = rnd.nextInt(256);
int ran7 = rnd.nextInt(256);
int ran8 = rnd.nextInt(256);
int ran9 = rnd.nextInt(256);
int ran10 = rnd.nextInt(256);
int ran11 = rnd.nextInt(256);
int ran12 = rnd.nextInt(256);
int ran13 = rnd.nextInt(256);
int ran14 = rnd.nextInt(256);
int ran15 = rnd.nextInt(256);
int ran16 = rnd.nextInt(256);
int ran17 = rnd.nextInt(256);
int ran18 = rnd.nextInt(256);
int ran19 = rnd.nextInt(256);
int ran20 = rnd.nextInt(256);
int ran21 = rnd.nextInt(256);
int ran22 = rnd.nextInt(256);
int ran23 = rnd.nextInt(256);
int ran24 = rnd.nextInt(256);
int ran25 = rnd.nextInt(256);
int ran26 = rnd.nextInt(256);
int ran27 = rnd.nextInt(256);
int ran28 = rnd.nextInt(256);
int ran29 = rnd.nextInt(256);
int ran30 = rnd.nextInt(256);
int ran31 = rnd.nextInt(256);
int ran32 = rnd.nextInt(256);
int ran33 = rnd.nextInt(256);
int ran34 = rnd.nextInt(256);
int ran35 = rnd.nextInt(256);
int ran36 = rnd.nextInt(256);
int ran37 = rnd.nextInt(256);
int ran38 = rnd.nextInt(256);
int ran39 = rnd.nextInt(256);
int ran40 = rnd.nextInt(256);
int ran41 = rnd.nextInt(256);
int ran42 = rnd.nextInt(256);
int ran43 = rnd.nextInt(256);
int ran44 = rnd.nextInt(256);
int ran45 = rnd.nextInt(256);
int ran46 = rnd.nextInt(256);
int ran47 = rnd.nextInt(256);
int ran48 = rnd.nextInt(256);
int ran49 = rnd.nextInt(256);
int ran50 = rnd.nextInt(256);
int ran51 = rnd.nextInt(256);
int ran52 = rnd.nextInt(256);
int ran53 = rnd.nextInt(256);
int ran54 = rnd.nextInt(256);
int ran55 = rnd.nextInt(256);
int ran56 = rnd.nextInt(256);
int ran57 = rnd.nextInt(256);
int ran58 = rnd.nextInt(256);
int ran59 = rnd.nextInt(256);
int ran60 = rnd.nextInt(256);
int ran61 = rnd.nextInt(256);
int ran62 = rnd.nextInt(256);
int ran63 = rnd.nextInt(256);
int ran64 = rnd.nextInt(256);
int ran65 = rnd.nextInt(256);
int ran66 = rnd.nextInt(256);
int ran67 = rnd.nextInt(256);
int ran68 = rnd.nextInt(256);
int ran69 = rnd.nextInt(256);
int ran70 = rnd.nextInt(256);
int ran71 = rnd.nextInt(256);
int ran72 = rnd.nextInt(256);
int ran73 = rnd.nextInt(256);
int ran74 = rnd.nextInt(256);
int ran75 = rnd.nextInt(256);
int ran76 = rnd.nextInt(256);
int ran77 = rnd.nextInt(256);
int ran78 = rnd.nextInt(256);
int ran79 = rnd.nextInt(256);
int ran80 = rnd.nextInt(256);
int ran81 = rnd.nextInt(256);
int ran82 = rnd.nextInt(256);
int ran83 = rnd.nextInt(256);
int ran84 = rnd.nextInt(256);
int ran85 = rnd.nextInt(256);
int ran86 = rnd.nextInt(256);
int ran87 = rnd.nextInt(256);
int ran88 = rnd.nextInt(256);
int ran89 = rnd.nextInt(256);
int ran90 = rnd.nextInt(256);
int ran91 = rnd.nextInt(256);
int ran92 = rnd.nextInt(256);
int ran93 = rnd.nextInt(256);
int ran94 = rnd.nextInt(256);
int ran95 = rnd.nextInt(256);
int ran96 = rnd.nextInt(256);
int ran97 = rnd.nextInt(256);
int ran98 = rnd.nextInt(256);
int ran99 = rnd.nextInt(256);
int ran100 = rnd.nextInt(256);
int ran101 = rnd.nextInt(256);
int ran102 = rnd.nextInt(256);
int ran103 = rnd.nextInt(256);
int ran104 = rnd.nextInt(256);
int ran105 = rnd.nextInt(256);
int ran106 = rnd.nextInt(256);
int ran107 = rnd.nextInt(256);
int ran108 = rnd.nextInt(256);
int ran109 = rnd.nextInt(256);
int ran110 = rnd.nextInt(256);
int ran111 = rnd.nextInt(256);
int ran112 = rnd.nextInt(256);
int ran113 = rnd.nextInt(256);
int ran114 = rnd.nextInt(256);
int ran115 = rnd.nextInt(256);
int ran116 = rnd.nextInt(256);
int ran117 = rnd.nextInt(256);
int ran118 = rnd.nextInt(256);

int ran01 = rnd.nextInt(12); //文字の大きさに比例して針の太さを変えるための工夫
int ran02 = ran01+ran01+20;

int ran03 = rnd.nextInt(6);
int ran04 = rnd.nextInt(8);

GregorianCalendar cal = new GregorianCalendar();
sec = (double)(cal.get(Calendar.SECOND));
min = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0;
hour = (double)(cal.get(Calendar.HOUR)) + min / 60.0;

if(ran01<2){

sec01 = (double)(cal.get(Calendar.SECOND))+0.1; //時計の針の太さの計算
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+0.5;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+0.2;

sec02 = (double)(cal.get(Calendar.SECOND))-0.1;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-0.5;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-0.2;

sec03 = (double)(cal.get(Calendar.SECOND))+0.4;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+1.5;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+0.6;

sec04 = (double)(cal.get(Calendar.SECOND))-0.4;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-1.5;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-0.6;

}else if(ran01<4){

sec01 = (double)(cal.get(Calendar.SECOND))+0.2;
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+1.0;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+0.4;

sec02 = (double)(cal.get(Calendar.SECOND))-0.2;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-1.0;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-0.4;

sec03 = (double)(cal.get(Calendar.SECOND))+0.8;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+3.0;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+1.2;

sec04 = (double)(cal.get(Calendar.SECOND))-0.8;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-3.0;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-1.2;

}else if(ran01<6){

sec01 = (double)(cal.get(Calendar.SECOND))+0.3;
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+1.5;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+0.6;

sec02 = (double)(cal.get(Calendar.SECOND))-0.3;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-1.5;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-0.6;

sec03 = (double)(cal.get(Calendar.SECOND))+1.2;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+4.5;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+1.8;

sec04 = (double)(cal.get(Calendar.SECOND))-1.2;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-4.5;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-1.8;

}else if(ran01<8){

sec01 = (double)(cal.get(Calendar.SECOND))+0.4;
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+2.0;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+0.8;

sec02 = (double)(cal.get(Calendar.SECOND))-0.4;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-2.0;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-0.8;

sec03 = (double)(cal.get(Calendar.SECOND))+1.6;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+6.0;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+2.4;

sec04 = (double)(cal.get(Calendar.SECOND))-1.6;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-6.0;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-2.4;

}else if(ran01<10){

sec01 = (double)(cal.get(Calendar.SECOND))+0.5;
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+2.5;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+1.0;

sec02 = (double)(cal.get(Calendar.SECOND))-0.5;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-2.5;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-1.0;

sec03 = (double)(cal.get(Calendar.SECOND))+2.0;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+7.5;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+3.0;

sec04 = (double)(cal.get(Calendar.SECOND))-2.0;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-7.5;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-3.0;

}else{

sec01 = (double)(cal.get(Calendar.SECOND))+0.6;
min01 = (double)(cal.get(Calendar.MINUTE)) + sec/ 60.0+3.0;
hour01 = (double)(cal.get(Calendar.HOUR)) + min/ 60.0+1.2;

sec02 = (double)(cal.get(Calendar.SECOND))-0.6;
min02 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-3.0;
hour02 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-1.2;

sec03 = (double)(cal.get(Calendar.SECOND))+2.4;
min03 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0+9.0;
hour03 = (double)(cal.get(Calendar.HOUR)) + min / 60.0+3.6;

sec04 = (double)(cal.get(Calendar.SECOND))-2.4;
min04 = (double)(cal.get(Calendar.MINUTE)) + sec / 60.0-9.0;
hour04 = (double)(cal.get(Calendar.HOUR)) + min / 60.0-3.6;

}

if (bstrategy.contentsLost() == false){
Insets insets = frame1.getInsets();
g.translate(insets.left, insets.top);
g.clearRect(0, 0, winSizeX, winSizeY);

g2d.setPaint(new Color(ran1, ran2, ran3)); //背景の色を塗る

int[] xpoints = {1, 400, 400, 1};
int[] ypoints = {0, 0, 329, 329};
int npoints = xpoints.length;
Polygon polygon = new Polygon(xpoints, ypoints, npoints);

g2d.fill(polygon);

g2d.setPaint(new Color(ran3, ran4, ran5));

int[] xpoints1 = {1, 400, 400, 1};
int[] ypoints1 = {330, 330, 379, 379};
int npoints1 = xpoints1.length;
Polygon polygon1 = new Polygon(xpoints1, ypoints1, npoints1);

g2d.fill(polygon1);

g2d.setPaint(new Color(ran6, ran7, ran8));

int[] xpoints2 = {1, 400, 400, 1};
int[] ypoints2 = {380, 380, 429, 429};
int npoints2 = xpoints1.length;
Polygon polygon2 = new Polygon(xpoints2, ypoints2, npoints2);

g2d.fill(polygon2);

g2d.setPaint(new Color(ran9, ran14, ran15));

int[] xpoints3 = {1, 400, 400, 1};
int[] ypoints3 = {430, 430, 480, 480};
int npoints3 = xpoints3.length;
Polygon polygon3 = new Polygon(xpoints3, ypoints3, npoints3);

g2d.fill(polygon3);

if(ran04<4){

Font f=new Font("TimesRoman",Font.BOLD,ran02); //文字盤のアラビア数字
g.setFont(f);

int x1 = centerX + (int)(Math.cos(DegrOf1h) * numPos);
int y1= centerY - (int)(Math.sin(DegrOf1h) * numPos);
g.setColor(Color.WHITE);
g.drawString("1", x1-ran01-1 , y1+ran01-1);
g.setColor(Color.GRAY);
g.drawString("1", x1-ran01+1 , y1+ran01+1);
g.setColor(new Color(ran1,ran2,ran3));
g.drawString("1", x1-ran01 , y1+ran01);

int x2 = centerX + (int)(Math.cos(DegrOf1h*2.0) * numPos);
int y2= centerY - (int)(Math.sin(DegrOf1h*2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("11", x2-ran01-6 , y2+ran01-1);
g.setColor(Color.GRAY);
g.drawString("11", x2-ran01-4 , y2+ran01+1);
g.setColor(new Color(ran4,ran5,ran6));
g.drawString("11", x2-ran01-5 , y2+ran01);

int x3 = centerX + (int)(Math.cos(DegrOf1h*3.0) * numPos);
int y3= centerY - (int)(Math.sin(DegrOf1h*3.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("9", x3-ran01-6 , y3+ran01+4);
g.setColor(Color.GRAY);
g.drawString("9", x3-ran01-4 , y3+ran01+6);
g.setColor(new Color(ran7,ran8,ran9));
g.drawString("9", x3-ran01-5 , y3+ran01+5);

int x4 = centerX + (int)(Math.cos(DegrOf1h*4.0) * numPos);
int y4= centerY - (int)(Math.sin(DegrOf1h*4.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("7", x4 -ran01-1, y4+ran01-1);
g.setColor(Color.GRAY);
g.drawString("7", x4 -ran01+1, y4+ran01+1);
g.setColor(new Color(ran10,ran11,ran12));
g.drawString("7", x4 -ran01, y4+ran01);

int x5 = centerX + (int)(Math.cos(DegrOf1h*5.0) * numPos);
int y5= centerY - (int)(Math.sin(DegrOf1h*5.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("5", x5-ran01-6 , y5+ran01-1);
g.setColor(Color.GRAY);
g.drawString("5", x5-ran01-4 , y5+ran01+1);
g.setColor(new Color(ran13,ran14,ran15));
g.drawString("5", x5-ran01-5 , y5+ran01);

int x6 = centerX + (int)(Math.cos(DegrOf1h*6.0) * numPos);
int y6= centerY - (int)(Math.sin(DegrOf1h*6.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("3", x6-ran01-3, y6+11);
g.setColor(Color.GRAY);
g.drawString("3", x6-ran01-1, y6+13);
g.setColor(new Color(ran16,ran17,ran18));
g.drawString("3", x6-ran01-2, y6+12);

int x7 = centerX + (int)(Math.cos(DegrOf1h/2.0) * numPos);
int y7= centerY - (int)(Math.sin(DegrOf1h/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("2", x7-ran01-1 , y7+ran01-1);
g.setColor(Color.GRAY);
g.drawString("2", x7-ran01+1 , y7+ran01+1);
g.setColor(new Color(ran19,ran20,ran21));
g.drawString("2", x7-ran01 , y7+ran01);

int x8 = centerX + (int)(Math.cos(DegrOf1h*3.0/2.0) * numPos);
int y8= centerY - (int)(Math.sin(DegrOf1h*3.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("12", x8-ran01-11 , y8+ran01-1);
g.setColor(Color.GRAY);
g.drawString("12", x8-ran01-9 , y8+ran01+1);
g.setColor(new Color(ran22,ran23,ran24));
g.drawString("12", x8-ran01-10, y8+ran01);

int x9 = centerX + (int)(Math.cos(DegrOf1h*5.0/2.0) * numPos);
int y9= centerY - (int)(Math.sin(DegrOf1h*5.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("10", x9-ran01-6 , y9+ran01-1);
g.setColor(Color.GRAY);
g.drawString("10", x9-ran01-4 , y9+ran01+1);
g.setColor(new Color(ran25,ran26,ran27));
g.drawString("10", x9-ran01-5, y9+ran01);

int x10 = centerX + (int)(Math.cos(DegrOf1h*7.0/2.0) * numPos);
int y10= centerY - (int)(Math.sin(DegrOf1h*7.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("8", x10-ran01-1 , y10+ran01-1);
g.setColor(Color.GRAY);
g.drawString("8", x10-ran01+1 , y10+ran01+1);
g.setColor(new Color(ran28,ran29,ran30));
g.drawString("8", x10-ran01 , y10+ran01);

int x11 = centerX + (int)(Math.cos(DegrOf1h*9.0/2.0) * numPos);
int y11= centerY - (int)(Math.sin(DegrOf1h*9.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("6", x11-ran01-6 , y11+ran01-1);
g.setColor(Color.GRAY);
g.drawString("6", x11-ran01-4 , y11+ran01+1);
g.setColor(new Color(ran31,ran32,ran33));
g.drawString("6", x11-ran01-5 , y11+ran01);

int x12 = centerX + (int)(Math.cos(DegrOf1h*11.0/2.0) * numPos);
int y12= centerY - (int)(Math.sin(DegrOf1h*11.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("4", x12-ran01-6 , y12+ran01-1);
g.setColor(Color.GRAY);
g.drawString("4", x12-ran01-4 , y12+ran01+1);
g.setColor(new Color(ran34,ran35,ran36));
g.drawString("4", x12-ran01-5 , y12+ran01);

}else{

Font f=new Font("TimesRoman",Font.ITALIC,ran02); //文字盤のローマ数字
g.setFont(f);

int x1 = centerX + (int)(Math.cos(DegrOf1h) * numPos);
int y1= centerY - (int)(Math.sin(DegrOf1h) * numPos);
g.setColor(Color.WHITE);
g.drawString("I", x1-ran01-1 , y1+ran01-1);
g.setColor(Color.GRAY);
g.drawString("I", x1-ran01+1 , y1+ran01+1);
g.setColor(new Color(ran37,ran38,ran39));
g.drawString("I", x1-ran01 , y1+ran01);

int x2 = centerX + (int)(Math.cos(DegrOf1h*2.0) * numPos);
int y2= centerY - (int)(Math.sin(DegrOf1h*2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("XI", x2-ran01-6 , y2+ran01-1);
g.setColor(Color.GRAY);
g.drawString("XI", x2-ran01-4 , y2+ran01+1);
g.setColor(new Color(ran40,ran41,ran42));
g.drawString("XI", x2-ran01-5 , y2+ran01);

int x3 = centerX + (int)(Math.cos(DegrOf1h*3.0) * numPos);
int y3= centerY - (int)(Math.sin(DegrOf1h*3.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("IX", x3-ran01-6 , y3+ran01+4);
g.setColor(Color.GRAY);
g.drawString("IX", x3-ran01-4, y3+ran01+6);
g.setColor(new Color(ran43,ran44,ran45));
g.drawString("IX", x3-ran01-5 , y3+ran01+5);

int x4 = centerX + (int)(Math.cos(DegrOf1h*4.0) * numPos);
int y4= centerY - (int)(Math.sin(DegrOf1h*4.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("VII", x4 -ran01-8, y4+ran01-1);
g.setColor(Color.GRAY);
g.drawString("VII", x4 -ran01-6, y4+ran01+1);
g.setColor(new Color(ran46,ran47,ran48));
g.drawString("VII", x4 -ran01-7, y4+ran01);

int x5 = centerX + (int)(Math.cos(DegrOf1h*5.0) * numPos);
int y5= centerY - (int)(Math.sin(DegrOf1h*5.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("V", x5-ran01-6 , y5+ran01-1);
g.setColor(Color.GRAY);
g.drawString("V", x5-ran01-4 , y5+ran01+1);
g.setColor(new Color(ran49,ran50,ran51));
g.drawString("V", x5-ran01-5 , y5+ran01);

int x6 = centerX + (int)(Math.cos(DegrOf1h*6.0) * numPos);
int y6= centerY - (int)(Math.sin(DegrOf1h*6.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("III", x6-ran01-6, y6+10);
g.setColor(Color.GRAY);
g.drawString("III", x6-ran01-4, y6+12);
g.setColor(new Color(ran52,ran53,ran54));
g.drawString("III", x6-ran01-5, y6+11);

int x7 = centerX + (int)(Math.cos(DegrOf1h/2.0) * numPos);
int y7= centerY - (int)(Math.sin(DegrOf1h/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("II", x7-ran01-1 , y7+ran01-1);
g.setColor(Color.GRAY);
g.drawString("II", x7-ran01+1 , y7+ran01+1);
g.setColor(new Color(ran55,ran56,ran57));
g.drawString("II", x7-ran01 , y7+ran01);

int x8 = centerX + (int)(Math.cos(DegrOf1h*3.0/2.0) * numPos);
int y8= centerY - (int)(Math.sin(DegrOf1h*3.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("XII", x8-ran01-10 , y8+ran01-1);
g.setColor(Color.GRAY);
g.drawString("XII", x8-ran01-8 , y8+ran01+1);
g.setColor(new Color(ran58,ran59,ran60));
g.drawString("XII", x8-ran01-9 , y8+ran01);

int x9 = centerX + (int)(Math.cos(DegrOf1h*5.0/2.0) * numPos);
int y9= centerY - (int)(Math.sin(DegrOf1h*5.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("X", x9-ran01-6 , y9+ran01-1);
g.setColor(Color.GRAY);
g.drawString("X", x9-ran01-4 , y9+ran01+1);
g.setColor(new Color(ran61,ran62,ran63));
g.drawString("X", x9-ran01-5, y9+ran01);

int x10 = centerX + (int)(Math.cos(DegrOf1h*7.0/2.0) * numPos);
int y10= centerY - (int)(Math.sin(DegrOf1h*7.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("VIII", x10-ran01-10 , y10+ran01-1);
g.setColor(Color.GRAY);
g.drawString("VIII", x10-ran01-8 , y10+ran01+1);
g.setColor(new Color(ran64,ran65,ran66));
g.drawString("VIII", x10-ran01-9 , y10+ran01);

int x11 = centerX + (int)(Math.cos(DegrOf1h*9.0/2.0) * numPos);
int y11= centerY - (int)(Math.sin(DegrOf1h*9.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("VI", x11-ran01-11 , y11+ran01-1);
g.setColor(Color.GRAY);
g.drawString("VI", x11-ran01-9 , y11+ran01+1);
g.setColor(new Color(ran67,ran68,ran69));
g.drawString("VI", x11-ran01-10 , y11+ran01);

int x12 = centerX + (int)(Math.cos(DegrOf1h*11.0/2.0) * numPos);
int y12= centerY - (int)(Math.sin(DegrOf1h*11.0/2.0) * numPos);
g.setColor(Color.WHITE);
g.drawString("IV", x12-ran01-6 , y12+ran01-1);
g.setColor(Color.GRAY);
g.drawString("IV", x12-ran01-4 , y12+ran01+1);
g.setColor(new Color(ran70,ran71,ran73));
g.drawString("IV", x12-ran01-5 , y12+ran01);

}

if(ran03<3){

String[] week_name = {"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"};

Calendar calendar = Calendar.getInstance();

int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DATE);
int hour1 = calendar.get(Calendar.HOUR_OF_DAY);
int hour2 = calendar.get(Calendar.AM_PM);
int hour3=hour1-12;
int minute = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
int week = calendar.get(Calendar.DAY_OF_WEEK) - 1;

String year0 = Integer.toString(year);
String month0 = Integer.toString(month);
String day0 = Integer.toString(day);
String hour0 = Integer.toString(hour2);
String hour4 = Integer.toString(hour3);
String minute0 = Integer.toString(minute);
String second0 = Integer.toString(second);

if(hour2==1){

g.setColor(Color.WHITE); //デジタル表示
g.drawString(hour4+":"+minute0+":"+second0+"p.m.", 150-ran02, 364);
g.drawString(year0+"/"+month0+"/"+day0,150-ran02, 414);
g.drawString(week_name[week], 150-ran02, 464);
g.setColor(Color.GRAY);
g.drawString(hour4+":"+minute0+":"+second0+"p.m.", 152-ran02, 366);
g.drawString(year0+"/"+month0+"/"+day0,152-ran02, 416);
g.drawString(week_name[week], 152-ran02, 466);
g.setColor(new Color(ran74,ran75,ran76));
g.drawString(hour4+":"+minute0+":"+second0+"p.m.", 151-ran02, 365);
g.setColor(new Color(ran77,ran78,ran79));
g.drawString(year0+"/"+month0+"/"+day0, 151-ran02, 415);
g.setColor(new Color(ran80,ran81,ran82));
g.drawString(week_name[week], 151-ran02, 465);

}else{

g.setColor(Color.WHITE);
g.drawString(hour1+":"+minute0+":"+second0+"a.m.", 150-ran02, 364);
g.drawString(year0+"/"+month0+"/"+day0,150-ran02, 414);
g.drawString(week_name[week], 150-ran02, 464);
g.setColor(Color.GRAY);
g.drawString(hour1+":"+minute0+":"+second0+"a.m.", 152-ran02, 366);
g.drawString(year0+"/"+month0+"/"+day0,152-ran02, 416);
g.drawString(week_name[week], 152-ran02, 466);
g.setColor(new Color(ran83,ran84,ran85));
g.drawString(hour1+":"+minute0+":"+second0+"a.m.", 151-ran02, 365);
g.setColor(new Color(ran86,ran87,ran88));
g.drawString(year0+"/"+month0+"/"+day0, 151-ran02, 415);
g.setColor(new Color(ran89,ran90,ran91));
g.drawString(week_name[week], 151-ran02, 465);

}
}else {

String[] week_name = {"日曜日", "月曜日", "火曜日", "水曜日",
"木曜日", "金曜日", "土曜日"};

Calendar calendar = Calendar.getInstance();

int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DATE);
int hour1 = calendar.get(Calendar.HOUR_OF_DAY);
int hour2 = calendar.get(Calendar.AM_PM);
int hour3=hour1-12;
int minute = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
int week = calendar.get(Calendar.DAY_OF_WEEK) - 1;

String year0 = Integer.toString(year);
String month0 = Integer.toString(month);
String day0 = Integer.toString(day);
String hour0 = Integer.toString(hour2);
String hour4 = Integer.toString(hour3);
String minute0 = Integer.toString(minute);
String second0 = Integer.toString(second);

if(hour2==1){

g.setColor(Color.WHITE);
g.drawString(year0+"年"+month0+"月"+day0+"日",100-ran01-ran02, 414+ran01);
g.drawString("午後"+hour4+"時"+minute0+"分"+second0+"秒", 100-ran01-ran02, 364+ran01);
g.drawString(week_name[week], 100-ran01-ran02, 464+ran01);
g.setColor(Color.GRAY);
g.drawString(year0+"年"+month0+"月"+day0+"日",102-ran01-ran02, 416+ran01);
g.drawString("午後"+hour4+"時"+minute0+"分"+second0+"秒", 102-ran01-ran02, 366+ran01);
g.drawString(week_name[week], 102-ran01-ran02, 466+ran01);
g.setColor(new Color(ran92,ran93,ran94));
g.drawString(year0+"年"+month0+"月"+day0+"日", 101-ran01-ran02, 415+ran01);
g.setColor(new Color(ran95,ran96,ran97));
g.drawString("午後"+hour4+"時"+minute0+"分"+second0+"秒", 101-ran01-ran02, 365+ran01);
g.setColor(new Color(ran98,ran99,ran100));
g.drawString(week_name[week], 101-ran01-ran02, 465+ran01);

}else{

g.setColor(Color.WHITE);
g.drawString(year0+"年"+month0+"月"+day0+"日",100-ran01-ran02, 414+ran01);
g.drawString("午前"+hour1+"時"+minute0+"分"+second0+"秒", 100-ran01-ran02, 364+ran01);
g.drawString(week_name[week], 100-ran01-ran02, 464+ran01);
g.setColor(Color.GRAY);
g.drawString(year0+"年"+month0+"月"+day0+"日",102-ran01-ran02, 416+ran01);
g.drawString("午前"+hour1+"時"+minute0+"分"+second0+"秒", 102-ran01-ran02, 366+ran01);
g.drawString(week_name[week], 102-ran01-ran02, 466+ran01);
g.setColor(new Color(ran101,ran102,ran103));
g.drawString(year0+"年"+month0+"月"+day0+"日", 101-ran01-ran02, 415+ran01);
g.setColor(new Color(ran104,ran105,ran106));
g.drawString("午前"+hour1+"時"+minute0+"分"+second0+"秒", 101-ran01-ran02, 365+ran01);
g.setColor(new Color(ran107,ran108,ran109));
g.drawString(week_name[week], 101-ran01-ran02, 465+ran01);

}
}

secAng = DegrOf0h - DegrPerSec * sec;
minAng = DegrOf0h - DegrPerMin * min;
hourAng = DegrOf0h - DegrPerHour * hour;

secAng1 = DegrOf0h - DegrPerSec * sec01;
minAng1 = DegrOf0h - DegrPerMin * min01;
hourAng1 = DegrOf0h - DegrPerHour * hour01;

secAng2 = DegrOf0h - DegrPerSec * sec02;
minAng2 = DegrOf0h - DegrPerMin * min02;
hourAng2 = DegrOf0h - DegrPerHour * hour02;

secAng3 = DegrOf0h - DegrPerSec * sec03;
minAng3 = DegrOf0h - DegrPerMin * min03;
hourAng3 = DegrOf0h - DegrPerHour * hour03;

secAng4 = DegrOf0h - DegrPerSec * sec04;
minAng4 = DegrOf0h - DegrPerMin * min04;
hourAng4 = DegrOf0h - DegrPerHour * hour04;

g2d.setPaint( Color.WHITE); //時計の針の表示

int[] xpoints7 = {centerX + (int)(Math.cos(hourAng) * hourHandLength1)-1, centerX + (int)(Math.cos(hourAng1) * hourHandLength3)-1, centerX - (int)(Math.cos(hourAng4) * hourHandLength2)-1, centerX - (int)(Math.cos(hourAng3) * hourHandLength2)-1, centerX + (int)(Math.cos(hourAng2) * hourHandLength3)-1, };
int[] ypoints7 = {centerY - (int)(Math.sin(hourAng) * hourHandLength1)-1, centerY - (int)(Math.sin(hourAng1) * hourHandLength3)-1, centerY + (int)(Math.sin(hourAng4) * hourHandLength2)-1, centerY + (int)(Math.sin(hourAng3) * hourHandLength2)-1, centerY - (int)(Math.sin(hourAng2) * hourHandLength3)-1, };

int npoints7 = xpoints7.length;
Polygon polygon7 = new Polygon(xpoints7, ypoints7, npoints7);

g2d.fill(polygon7);

g2d.setPaint( Color.GRAY);

int[] xpoints10 = {centerX + (int)(Math.cos(hourAng) * hourHandLength1)+1, centerX + (int)(Math.cos(hourAng1) * hourHandLength3)+1, centerX - (int)(Math.cos(hourAng4) * hourHandLength2)+1, centerX - (int)(Math.cos(hourAng3) * hourHandLength2)+1, centerX + (int)(Math.cos(hourAng2) * hourHandLength3)+1, };
int[] ypoints10 = {centerY - (int)(Math.sin(hourAng) * hourHandLength1)+1, centerY - (int)(Math.sin(hourAng1) * hourHandLength3)+1, centerY + (int)(Math.sin(hourAng4) * hourHandLength2)+1, centerY + (int)(Math.sin(hourAng3) * hourHandLength2)+1, centerY - (int)(Math.sin(hourAng2) * hourHandLength3)+1, };

int npoints10 = xpoints10.length;
Polygon polygon10 = new Polygon(xpoints10, ypoints10, npoints10);

g2d.fill(polygon10);

g2d.setPaint(new Color(ran110, ran111, ran112));

int[] xpoints4 = {centerX + (int)(Math.cos(hourAng) * hourHandLength1), centerX + (int)(Math.cos(hourAng1) * hourHandLength3), centerX - (int)(Math.cos(hourAng4) * hourHandLength2), centerX - (int)(Math.cos(hourAng3) * hourHandLength2), centerX + (int)(Math.cos(hourAng2) * hourHandLength3), };
int[] ypoints4 = {centerY - (int)(Math.sin(hourAng) * hourHandLength1), centerY - (int)(Math.sin(hourAng1) * hourHandLength3), centerY + (int)(Math.sin(hourAng4) * hourHandLength2), centerY + (int)(Math.sin(hourAng3) * hourHandLength2), centerY - (int)(Math.sin(hourAng2) * hourHandLength3), };

int npoints4 = xpoints4.length;
Polygon polygon4 = new Polygon(xpoints4, ypoints4, npoints4);

g2d.fill(polygon4);

g2d.setPaint( Color.WHITE);

int[] xpoints8 = {centerX + (int)(Math.cos(minAng) * minHandLength1)-1, centerX + (int)(Math.cos(minAng1) * minHandLength3)-1, centerX - (int)(Math.cos(minAng4) * minHandLength2)-1, centerX - (int)(Math.cos(minAng3) * minHandLength2)-1, centerX + (int)(Math.cos(minAng2) * minHandLength3)-1, };
int[] ypoints8 = {centerY - (int)(Math.sin(minAng) * minHandLength1)-1, centerY - (int)(Math.sin(minAng1) * minHandLength3)-1, centerY + (int)(Math.sin(minAng4) * minHandLength2)-1, centerY + (int)(Math.sin(minAng3) * minHandLength2)-1, centerY - (int)(Math.sin(minAng2) * minHandLength3)-1, };

int npoints8 = xpoints8.length;
Polygon polygon8 = new Polygon(xpoints8, ypoints8, npoints8);

g2d.fill(polygon8);

g2d.setPaint( Color.GRAY);

int[] xpoints11 = {centerX + (int)(Math.cos(minAng) * minHandLength1)+1, centerX + (int)(Math.cos(minAng1) * minHandLength3)+1, centerX - (int)(Math.cos(minAng4) * minHandLength2)+1, centerX - (int)(Math.cos(minAng3) * minHandLength2)+1, centerX + (int)(Math.cos(minAng2) * minHandLength3)+1, };
int[] ypoints11 = {centerY - (int)(Math.sin(minAng) * minHandLength1)+1, centerY - (int)(Math.sin(minAng1) * minHandLength3)+1, centerY + (int)(Math.sin(minAng4) * minHandLength2)+1, centerY + (int)(Math.sin(minAng3) * minHandLength2)+1, centerY - (int)(Math.sin(minAng2) * minHandLength3)+1, };

int npoints11 = xpoints11.length;
Polygon polygon11 = new Polygon(xpoints11, ypoints11, npoints11);

g2d.fill(polygon11);

g2d.setPaint(new Color(ran113, ran114, ran115));

int[] xpoints5 = {centerX + (int)(Math.cos(minAng) * minHandLength1), centerX + (int)(Math.cos(minAng1) * minHandLength3), centerX - (int)(Math.cos(minAng4) * minHandLength2), centerX - (int)(Math.cos(minAng3) * minHandLength2), centerX + (int)(Math.cos(minAng2) * minHandLength3), };
int[] ypoints5 = {centerY - (int)(Math.sin(minAng) * minHandLength1), centerY - (int)(Math.sin(minAng1) * minHandLength3), centerY + (int)(Math.sin(minAng4) * minHandLength2), centerY + (int)(Math.sin(minAng3) * minHandLength2), centerY - (int)(Math.sin(minAng2) * minHandLength3), };

int npoints5 = xpoints5.length;
Polygon polygon5 = new Polygon(xpoints5, ypoints5, npoints5);

g2d.fill(polygon5);

g2d.setPaint(Color.WHITE);

int[] xpoints9 = {centerX + (int)(Math.cos(secAng) * secHandLength1)-1, centerX + (int)(Math.cos(secAng1) * secHandLength3)-1, centerX - (int)(Math.cos(secAng4) * secHandLength2)-1, centerX - (int)(Math.cos(secAng3) * secHandLength2)-1, centerX + (int)(Math.cos(secAng2) * secHandLength3)-1, };
int[] ypoints9 = {centerY - (int)(Math.sin(secAng) * secHandLength1)-1, centerY - (int)(Math.sin(secAng1) * secHandLength3)-1, centerY + (int)(Math.sin(secAng4) * secHandLength2)-1, centerY + (int)(Math.sin(secAng3) * secHandLength2)-1, centerY - (int)(Math.sin(secAng2) * secHandLength3)-1, };

int npoints9 = xpoints9.length;
Polygon polygon9 = new Polygon(xpoints9, ypoints9, npoints9);

g2d.fill(polygon9);

g2d.setPaint(Color.GRAY);

int[] xpoints12 = {centerX + (int)(Math.cos(secAng) * secHandLength1)+1, centerX + (int)(Math.cos(secAng1) * secHandLength3)+1, centerX - (int)(Math.cos(secAng4) * secHandLength2)+1, centerX - (int)(Math.cos(secAng3) * secHandLength2)+1, centerX + (int)(Math.cos(secAng2) * secHandLength3)+1, };
int[] ypoints12 = {centerY - (int)(Math.sin(secAng) * secHandLength1)+1, centerY - (int)(Math.sin(secAng1) * secHandLength3)+1, centerY + (int)(Math.sin(secAng4) * secHandLength2)+1, centerY + (int)(Math.sin(secAng3) * secHandLength2)+1, centerY - (int)(Math.sin(secAng2) * secHandLength3)+1, };

int npoints12 = xpoints12.length;
Polygon polygon12 = new Polygon(xpoints12, ypoints12, npoints12);

g2d.fill(polygon12);

g2d.setPaint(new Color(ran116, ran117,ran118));

int[] xpoints6 = {centerX + (int)(Math.cos(secAng) * secHandLength1), centerX + (int)(Math.cos(secAng1) * secHandLength3), centerX - (int)(Math.cos(secAng4) * secHandLength2), centerX - (int)(Math.cos(secAng3) * secHandLength2), centerX + (int)(Math.cos(secAng2) * secHandLength3), };
int[] ypoints6 = {centerY - (int)(Math.sin(secAng) * secHandLength1), centerY - (int)(Math.sin(secAng1) * secHandLength3), centerY + (int)(Math.sin(secAng4) * secHandLength2), centerY + (int)(Math.sin(secAng3) * secHandLength2), centerY - (int)(Math.sin(secAng2) * secHandLength3), };

int npoints6 = xpoints6.length;
Polygon polygon6 = new Polygon(xpoints6, ypoints6, npoints6);

g2d.fill(polygon6);

bstrategy.show();
g.dispose();
}
}
}
}