JavaFX Canvas misses API to set dashed line stroke

David Gilbert dave at
Tue Jul 22 09:42:50 UTC 2014


I have created a small open source library that provides a bridge from Java2D to the JavaFX Canvas:

Unfortunately I have so far not been able to support dashed lines, since the GraphicsContext from the JavaFX Canvas doesn't provide any API to set the line dash attributes.  Did I miss something, or is there really no way to specify dashed lines?  I know this is possible in the Shape API ( but I am specifically interested in drawing dashed lines on the JavaFX Canvas.  Any pointers will be appreciated.

Best regards,


More information about the openjfx-dev mailing list