java - How do I use decimals when spacing a graphic -
java - How do I use decimals when spacing a graphic -
i'm trying space lines on graphic creating cant seem yo able input decimal number (3.5) value space between lines in graphics. @ moment have input value 4 code wrong.
the code using below;
for (int = 0; < 3; i++) g.drawline(185, 130 - 4*i, 260, 130 - 4*i);
does have suggestions how input decimals value?
you should utilize graphics2d
object instead. code this:
graphics2d g2d = (graphics2d) g; (int = 0; < 3; i++) g.draw(new line2d.double(185, 130 - 3.5*i, 260, 130 - 3.5*i);
java graphics
Comments
Post a Comment