import java.awt.*; import java.io.*; public class Kell2 extends Frame{ int t, m; public Kell2(int tunnid, int minutid){ setTitle("Kellake"); setSize(400, 400); t=tunnid; m=minutid; setVisible(true); } public void paint(Graphics g){ g.setColor(Color.yellow); g.fillOval(100, 100, 200, 200); g.setColor(Color.black); g.drawOval(100, 100, 200, 200); g.drawOval(195, 195, 5, 5); g.drawString("Tunnid: "+t+"", 50, 50); g.drawString("Minutid: "+m+"", 50, 70); int min=m/5; int x=233; int y=133; for(int i=1; i<6; i++){ if(i==t)g.drawLine(200, 200, x, y); if(i==min)g.drawLine(200, 200, x, y); g.drawString(i+"", x, y); y=y+33; if(i>=3)x=x-33; if(i<3)x=x+33; } x=200; y=300; g.drawString("6", x, y); if(t==6)g.drawLine(200, 200, x, y); if(min==6)g.drawLine(200, 200, x, y); for(int k=7; k<13; k++){ y=y-33; if(k<=9)x=x-33; if(k>9)x=x+33; g.drawString(k+"", x, y); if(k==t)g.drawLine(200, 200, x, y); if(k==min)g.drawLine(200, 200, x, y); } } public static void main(String argumendid[]) throws Exception{ int tunnid; int minutid; String s; PrintWriter valja=new PrintWriter(System.out, true); BufferedReader sisse=new BufferedReader( new InputStreamReader(System.in) ); valja.println("Sisesta tunnid:"); s=sisse.readLine(); tunnid=Integer.valueOf(s).intValue(); valja.println("Sisesta minutid:"); s=sisse.readLine(); minutid=Integer.valueOf(s).intValue(); new Kell2(tunnid, minutid); } }