From the course: Learning JavaFX GUI Development

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Draw text

Draw text

From the course: Learning JavaFX GUI Development

Start my 1-month free trial

Draw text

- [Voiceover] When you're designing your user interface, a lot of times, you'll need to put text at certain areas on the screen. We can use the JavaFX Text Class to help us out. The JavaFX Text class inherits directly from the Node class. This is important, because this allows us to apply special effects, animation, and transformations to our text. Remember, it is also possible to style your text using cascading style sheet, or CSS. Let's take a look at a net themes project. We'll start by adding text to the page and then changing the font and fill color using CSS. I'm going to start a new project, and I'm going to call it add text with style. Okay, for this page, what I'd like to do is have some text across the top, maybe like a banner, also, text on the left and right hand sides, text in the center, and text in the bottom, almost like a footer. To make the text centered horizontally and vertically, we can use our H box and V box UI layout, and then add them to the boarder pane…

Contents