Java小时钟程序的问题,谁能帮我解决一下?
今天编了一个时钟小程序,代码如下:
import java.awt.*;
import javax.swing.*;
import java.util.*;
public class ClockJFrame extends JFrame implements Runnable
{
private int r,a,b;//半径r、圆心(a,b)
private int h,m,s;//时、分、秒
private int hp,mp,sp;//时钟、分钟、秒钟的长度
public ClockJFrame(int h,int m,int s)
{
this.h=h;
this.m=m;
this.s=s;
r=150;
a=250;
b=200;
hp=(int)(3*r/5);
mp=(int)(4*r/5);
sp=r+3;
this.setSize(500,500);
this.setVisible(true);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void paint(Graphics g)
{
g.setColor(Color.blue);
g.drawOval(a-r-5,b-r-12,2*r+15,2*r+15);
g.drawOval(a-r-7,b-r-14,2*r+19,2*r+19);//画两个圈代表时钟外壳
g.fillOval(a-(int)(10*Math.cos(Math.PI/4)),b-(int)(10*Math.cos(Math.PI/4)),13,13);//绘制中心点
//为时钟添加数字: &
相关问答:
不知道是什么原因,我该如何处理,请大虾们指教了,小弟在此谢过。。。。
错误信息如下:
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context t ......
1 public class BirthDate {
2 private int day;
3 private int month;
4 private int year;
5
6 public BirthDate (){}
7
8 public BirthDate (int d,int m,int y){
9 day = d;
......
import java.io.*;
class FileTest
{
public static void main(String [] args) throws Exception
{
File fDir=new File(File.separator);
String strFile="java源代码测试"+File.separato ......
如题。
遥遥无期啊,买房难啊
22世纪吧,,,
明天就可以,但是明天永远是明天啊!!!!
买房?不是it民工想的。
加油吧~``
我觉得也是 房自己随便盖一个既是.... 买咱是别想了 ......
要求:
(1)本科或大专以上
(2)Java程序员(有一定的Java或Jsp开发经验)
(3)熟练掌握SQL语言、脚本语言javascript,动态网页jsp,静态网页html,CSS。
(4)熟悉SQL server 2k、Oracle或DB2或mySQL ......