Example usage for javafx.scene.paint Color web

List of usage examples for javafx.scene.paint Color web

Introduction

In this page you can find the example usage for javafx.scene.paint Color web.

Prototype

public static Color web(String colorString) 

Source Link

Document

Creates an RGB color specified with an HTML or CSS attribute string.

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF"));

    Circle circle = new Circle();
    circle.setCenterX(100.0f);//from w  w  w. j  av  a 2 s . co  m
    circle.setCenterY(100.0f);
    circle.setRadius(50.0f);

    root.getChildren().add(circle);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF"));

    Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com");
    Font sanSerif = Font.font("Dialog", 30);
    text.setFont(sanSerif);/*w  w w.j a  v a 2 s.c  o m*/
    text.setFill(Color.RED);
    root.getChildren().add(text);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF"));

    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putString("some text");
    content.put(DataFormat.PLAIN_TEXT, "other text");
    clipboard.setContent(content);//from  ww w .j a v a2  s  .c o  m

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Label Sample");
    stage.setWidth(400);/*from  w  w  w  . j ava  2  s.c o m*/
    stage.setHeight(180);

    HBox hbox = new HBox();

    Label label1 = new Label("Search");
    label1.setTextFill(Color.web("#0076a3"));

    hbox.setSpacing(10);
    hbox.getChildren().add((label1));
    ((Group) scene.getRoot()).getChildren().add(hbox);

    stage.setScene(scene);
    stage.show();
}

From source file:webviewsample.Main.java

@Override
public void start(Stage stage) {
    // create scene
    stage.setTitle("Web View");
    scene = new Scene(new Browser(), 750, 500, Color.web("#666970"));
    stage.setScene(scene);/*from w ww  . ja  v a  2s. c om*/
    scene.getStylesheets().add("webviewsample/BrowserToolbar.css");
    // show stage
    stage.show();
}

From source file:org.cryptomator.ui.util.PasswordStrengthUtil.java

public Color getStrengthColor(Number score) {
    switch (score.intValue()) {
    case 0://from   w  ww . j a  v  a2s. com
        return Color.web("#e74c3c");
    case 1:
        return Color.web("#e67e22");
    case 2:
        return Color.web("#f1c40f");
    case 3:
        return Color.web("#40d47e");
    case 4:
        return Color.web("#27ae60");
    default:
        return Color.web("#ffffff", 0.5);
    }
}

From source file:eu.ggnet.dwoss.receipt.shipment.ShipmentUpdateStage.java

private boolean isValid() {
    isOk = (shipment.getContractor() != null && !StringUtils.isBlank(shipment.getShipmentId())
            && shipment.getStatus() != null && shipment.getDefaultManufacturer() != null);
    if (!isOk) {/*w  w w .j a v  a 2  s .  co m*/
        errorLabel.setTextFill(Color.web("#600000"));
    }
    return isOk;
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);/*w w  w  .ja v  a  2  s  .  c  o  m*/
    stage.setTitle("Password Field Sample");

    VBox vb = new VBox();
    vb.setPadding(new Insets(10, 0, 0, 10));
    vb.setSpacing(10);
    HBox hb = new HBox();
    hb.setSpacing(10);
    hb.setAlignment(Pos.CENTER_LEFT);

    Label label = new Label("Password");
    final PasswordField pb = new PasswordField();

    pb.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            if (!pb.getText().equals("abc")) {
                message.setText("Your password is incorrect!");
                message.setTextFill(Color.web("red"));
            } else {
                message.setText("Your password has been confirmed");
                message.setTextFill(Color.web("black"));
            }
            pb.setText("");
        }
    });

    hb.getChildren().addAll(label, pb);
    vb.getChildren().addAll(hb, message);

    scene.setRoot(vb);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    VBox box = new VBox();
    Scene scene = new Scene(box, 200, 200);
    stage.setScene(scene);// w  w  w.ja v a  2s . c o  m
    stage.setTitle("ListViewSample");
    box.getChildren().addAll(list, label);
    VBox.setVgrow(list, Priority.ALWAYS);

    label.setLayoutX(10);
    label.setLayoutY(115);
    label.setFont(Font.font("Verdana", 20));

    list.setItems(data);

    list.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {
        @Override
        public ListCell<String> call(ListView<String> list) {
            return new ColorRectCell();
        }
    });

    list.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
        public void changed(ObservableValue<? extends String> ov, String old_val, String new_val) {
            label.setText(new_val);
            label.setTextFill(Color.web(new_val));
        }
    });
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = SceneBuilder.create().width(320).height(343)
            .root(GroupBuilder.create()//from w w  w. ja v  a 2 s.c om
                    .children(
                            RectangleBuilder.create().width(320).height(45)
                                    .fill(LinearGradientBuilder.create().endX(0.0).endY(1.0)
                                            .stops(new Stop(0, Color.web("0xAEBBCC")),
                                                    new Stop(1, Color.web("0x6D84A3")))
                                            .build())
                                    .build(),
                            TextBuilder
                                    .create().layoutX(65).layoutY(12).textOrigin(VPos.TOP).fill(Color.WHITE)
                                    .text("Audio Configuration")
                                    .font(Font.font("SansSerif", FontWeight.BOLD, 20)).build(),
                            RectangleBuilder
                                    .create().x(0).y(43).width(320).height(300).fill(Color.rgb(199, 206, 213))
                                    .build(),
                            RectangleBuilder
                                    .create().x(9).y(54).width(300).height(130).arcWidth(20).arcHeight(20)
                                    .fill(Color.WHITE).stroke(Color.color(0.66, 0.67, 0.69)).build(),
                            textDb = TextBuilder.create().layoutX(18).layoutY(69).textOrigin(VPos.TOP)
                                    .fill(Color.web("#131021"))
                                    .font(Font.font("SansSerif", FontWeight.BOLD, 18)).build(),
                            slider = SliderBuilder.create().layoutX(135).layoutY(69).prefWidth(162)
                                    .min(acModel.minDecibels).max(acModel.maxDecibels).build(),
                            LineBuilder
                                    .create().startX(9).startY(97).endX(309).endY(97)
                                    .stroke(Color.color(0.66, 0.67, 0.69)).build(),
                            TextBuilder.create().layoutX(18).layoutY(113).textOrigin(VPos.TOP)
                                    .fill(Color.web("#131021")).text("Muting")
                                    .font(Font.font("SanSerif", FontWeight.BOLD, 18)).build(),
                            mutingCheckBox = CheckBoxBuilder.create().layoutX(280).layoutY(113).build(),
                            LineBuilder.create().startX(9).startY(141).endX(309).endY(141)
                                    .stroke(Color.color(0.66, 0.67, 0.69)).build(),
                            TextBuilder.create().layoutX(18).layoutY(154).textOrigin(VPos.TOP)
                                    .fill(Color.web("#131021")).text("Genre")
                                    .font(Font.font("SanSerif", FontWeight.BOLD, 18)).build(),
                            genreChoiceBox = ChoiceBoxBuilder.create().layoutX(204).layoutY(154).prefWidth(93)
                                    .items(acModel.genres).build())
                    .build())
            .build();

    textDb.textProperty().bind(acModel.selectedDBs.asString().concat(" dB"));
    slider.valueProperty().bindBidirectional(acModel.selectedDBs);
    slider.disableProperty().bind(acModel.muting);
    mutingCheckBox.selectedProperty().bindBidirectional(acModel.muting);
    acModel.genreSelectionModel = genreChoiceBox.getSelectionModel();
    acModel.addListenerToGenreSelectionModel();
    acModel.genreSelectionModel.selectFirst();

    stage.setScene(scene);
    stage.setTitle("Audio Configuration");
    stage.show();
}