-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
The simple geometrical shapes offered by the Shape API may not adequately meet your requirements. JavaFX also offers the Path API to simplify the creation of complex and irregular shapes using a step-wise approach of drawing shape segments. In this recipe, you will learn how to use the Path API and its associated classes to create a complex shape.
Before you can draw complex shapes using JavaFX, you must know how to create a basic JavaFX application and how to add content to the application's scene. To refresh your memory, see recipe Building a JavaFX application from this chapter. It will also be helpful to review the recipe Drawing simple shapes to get an idea of how the Shape API works. To use the Path API, you will need to import classes found in the javafx.scene.shape package.
The next code snippet is an example of how to use the Path API to create irregular shapes. You can find the complete listing of this code in ch002...
Change the font size
Change margin width
Change background colour