JavaFX – SVGPath

We recently celebrated Holi – Festival of Colours.
It was real fun! Now lets try to celebrate Holi with JavaFX!.

You can create an SVG path in JavaFX using SVGPath class. It accepts content which is a string formatted as specified here.

SVGPath {
    content: "M48.859,43.518c8.424,17.64,2.736,140.832-7.128,184.032"
    fill: Color.BLACK

We can combine a series of SVGPath to create the final image. Now we can manipulate attributes of individual SVGPath such as fill, stroke, strokeWidth etc. I’m using the same ColorChooser code as in previous post.

For Applet mode, click on above image

For standalone mode

To paint Duke select any part of Duke and then select a color from color chooser.
Now you can play Holi with Duke! Have fun!


var dzone_url = “”;
var dzone_style = ‘2’;