I'm trying to create a line with a different fill and stroke color, something like this:
I have tried the following:
Line line = new Line(0,0,100,100);
line.setFill(Color.RED);
line.setStroke(Color.BLACK);
line.setStrokeWidth(10);
but this gives me just a black line.
Is what I'm trying to do possible with a simple Line or do I have to use another Shape
? (I would prefer using a line because I have to frequently call the setStartX
, setStartY
, ... methods)