JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

Using the JFXColorPicker without the button. Possible?

Open SKeeneCode opened this issue 5 years ago • 1 comments

I have a treeview holding many colored labels. I want to be able to launch the color picker dialog when I click on these controls and bind the color picker value to my controls background:

image

I can launch the dialog itself easy enough (using TornadoFX here):

onRightClick {
           JFXCustomColorPickerDialog(currentStage).show()
}

But I have no way as far as I can tell, to access the value property so I can get the color result (infact, launching the dialog like this then exiting it causes a NPE).

Is it possible to get around this?

SKeeneCode avatar Oct 22 '20 14:10 SKeeneCode

Hi, there is a workaround for this. try the following code snippet

JFXColorPicker picker = new JFXColorPicker();
picker.setManaged(false);
JFXButton btn = new JFXButton("Show");
btn.setOnAction((action) -> picker.show());
root.getChildren().addAll(picker, btn);

sshahine avatar Jan 06 '21 10:01 sshahine