I dont know what I messed up here. I'm doing a digital clock, and try to put some labels in it, but for some reason the height coordinates switched signs.
public void paintComponent(Graphics gr){
super.paintComponent(gr);
double XX=hossz*Math.sin(Math.toRadians(szogS));
double YY=hossz*Math.cos(Math.toRadians(szogS));
int X=(int)XX;
int Y=(int)YY;
double XXM=hossz*Math.sin(Math.toRadians(szogM));
double YYM=hossz*Math.cos(Math.toRadians(szogM));
int XM=(int)XXM;
int YM=(int)YYM;
gr.translate(getWidth()/2, getHeight()/2);
gr.drawLine(0, 0, -X, -Y);
gr.drawLine(0, 0, -XM, -YM);
gr.drawString("12", 0, 120);
gr.drawString("3", 120, 0);
gr.drawString("6", 0, -120);
gr.drawString("9", -120, 0);
}
I drew my first string (12) at x 0 y 120, however when i run the program the "6" is at the top of the clock. What did i do wrong?