Remove text from color set

The JavaFX color selection is pretty neat, but it always seems like it displays the textual representation of the color, as well as the color itself:

JavaFX color dialog with text

I would like it without text, just with a square of color, but it seems that he can’t find a way to style it. The only thing that comes close, I tried so far to limit the width of the control so that the text does not display:

picker.setMaxWidth(30);

... but it seems incredibly hacked and still produces a "..." on the side of the button where the text was cropped:

enter image description here

Any ideas?

+4
source share
1 answer

Try

colorpicker.setStyle ("- fx-color-label-visible: false;");

+7
source

All Articles