Java Reference
In-Depth Information
+ "-fx-border-insets: 5;\n"
+ "-fx-border-width: 3;\n"
+ "-fx-border-style: dashed;\n";
cssEditorFld.setText(cssDefault);
// Border decorate the picture
final ImageView imv = new ImageView();
final Image image2 = new
Image(GeneratingBorders.class.getResourceAsStream("smoke_glass_buttons1.png"));
imv.setImage(image2);
final HBox pictureRegion = new HBox();
pictureRegion.setStyle(cssDefault);
pictureRegion.getChildren().add(imv);
gridpane.add(pictureRegion, 1, 1);
Button apply = new Button("Bling!");
GridPane.setHalignment(apply, HPos.RIGHT);
gridpane.add(apply, 0, 2);
apply.setOnAction((e) -> {
pictureRegion.setStyle(cssEditorFld.getText());
});
root.getChildren().add(gridpane);
primaryStage.setScene(scene);
primaryStage.show();
Figure 14-9 illustrates the border customizer application.
 
Search WWH ::




Custom Search