Reputation: 373
I would like to ask whether it is possible to draw a line using double variables instead of integers. If yes how?
Upvotes: 0
Views: 3186
Reputation: 5399
Like this ?
Line2D line = new Line2D.Double();
Graphics2D g2 = aPaintContext.getGraphics();
for (double x = bx; x < rightBorder; x += 5) {
line.setLine(x, by, x, bottomBorder);
g2.draw(line);
Upvotes: 1
Reputation: 21233
You can use Line2D.Double. Use Graphics2D.draw() to draw it.
See Drawing Geometric Primitives for more details and examples.
Upvotes: 2