JDashPanel

This panel can be used for creating SLD editor panels.
It handle a few possibilities of the SLD Dashes object.

It's also a bean, so you can add it in the Swing Palette of NetBeans Matisse WYSIWYG for example.

How to use it ?

JDashPanel guiStrokeDashes = new JDashPanel();

//apply the Dashes properties
guiStrokeDashes.setDashes(stroke.getDashArray());
guiStrokeDashes.setOffset(stroke.getDashOffset());

//get back the properties
stroke.setDashArray(guiStrokeDashes.getDashes());
stroke.setDashOffset(guiStrokeDashes.getOffset());