08/03/19 23:27:58
180°の弧を描くアナログメータを作りたいんですけどうまくいきません
下のようなpaintメソッドではいけないのでしょうか?
真ん中に直線が描かれるだけで何もなりません
double i = 0;
int x = 200;
int y = 200;
public void paint(Graphics g){
g.drawLine(x,y,200,300);
Double xx = new Double(200 + Math.sin(1/20 * i) * 200);
x = xx.intValue();
Double yy = new Double(200 - Math.rint(Math.cos(1/20 * i) * 200));
y = yy.intValue();
i += 1;
}