O'Reilly logo

JavaFX 2.0: Introduction by Example by Carl Dea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1-9. Generating Borders

Problem

You want to create and customize borders around an image.

Solution

Create an application to dynamically customized border regions using JavaFX’s CSS styling API.

The following code creates an application that has a CSS editor text area and a border view region surrounding an image. By default the editor’s text area will contain JavaFX styling selectors that create a dashed-blue line surrounding the image. You will have the opportunity to modify styling selector values in the CSS Editor by clicking the Bling! button to apply border settings.

primaryStage.setTitle("Chapter 1-9 Generating Borders"); Group root = new Group(); Scene scene = new Scene(root, 600, 330, Color.WHITE); // create a grid pane GridPane gridpane ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required