Reputation: 3257
I know that i can use Line2D
.
But is there any way that i can draw two parallel lines using GeneralPath
Class ?
Upvotes: 0
Views: 1326
Reputation: 1525
Its possible please find the below code
@Override
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D)g;
GeneralPath path = new GeneralPath();
path.moveTo(10, 10);
path.lineTo(10, 100);
path.moveTo(100, 10);
path.lineTo(100, 100);
g2d.draw(path);
}
Upvotes: 2