@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { ColorPicker colorPicker = (ColorPicker) component; Converter converter = colorPicker.getConverter(); String value; if (converter != null) { value = converter.getAsString(context, component, colorPicker.getValue()); } else { value = (String) colorPicker.getValue(); } encodeMarkup(context, colorPicker, value); encodeScript(context, colorPicker, value); }
final ColorPicker colorPicker = new ColorPicker(); colorPicker.setOnAction(new EventHandler() { public void handle(Event t) { Color c = colorPicker.getValue(); System.out.println("New Color's RGB = "+c.getRed()+" "+c.getGreen()+" "+c.getBlue()); } });
final ColorPicker colorPicker = new ColorPicker(Color.CYAN); colorPicker.setOnAction(e -> { Color color = colorPicker.getValue(); String hex = String.format("#%02x02x02x", (int) (color.getRed() * 255), (int) (color.getGreen() * 255), (int) (color.getBlue() * 255)); Text.setText(hex); ShortcutButton.setBackground( new Background(new BackgroundFill(color, null, null))); }); myLayoutPane.getChildren().add(colorPicker);
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { ColorPicker colorPicker = (ColorPicker) component; Converter converter = colorPicker.getConverter(); String value; if (converter != null) { value = converter.getAsString(context, component, colorPicker.getValue()); } else { value = (String) colorPicker.getValue(); } encodeMarkup(context, colorPicker, value); encodeScript(context, colorPicker, value); }
public void handle(ActionEvent event) root.setBackground(new Background(new BackgroundFill(colorssPicker.getValue(),null,null)));
canvas.getGraphicsContext2D().setFill(cp.getValue()); canvas.getGraphicsContext2D().fillOval(20, 20, 20, 20); });
brushVariations[i] = createBrush(size, colorPicker.getValue());
if (!wasShownCalled) { wasShownCalled = true; setBarColor(bar, picker.getValue()); picker.valueProperty().addListener(COLOR_LISTENER);
fontSize.set(fontSizeChoice.getValue()); italic.set(italicCheckBox.isSelected()); fontFill.set(colorPicker.getValue()); stage.hide(); });