O'Reilly logo

JavaFX 1.2 Application Development Cookbook by Vladimir Vivien

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

Drawing letter shapes using the Text class

Beside geometric shapes (see the recipe Drawing simple shapes), one of the most fundamental node types available in JavaFX is the Text node. This node is used to draw letter shapes on the screen that can be manipulated just like other node types offered by the JavaFX platform. In this recipe, you will learn how to work with the Text class to display text on your application's screen.

Getting ready

Before you can draw text using JavaFX, you must know how to create a basic JavaFX application and know how to add content to the application's scene. To refresh your memory, see the recipe Building a JavaFX application. To display text, you will need to import the Text class found in the package javafx.scene.text ...

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