4. Graphical Objects

Graphical objects and their manipulation are where JavaFX excels. This chapter shows you how to define and control graphical objects in JavaFX.

We begin at the top-level Stage and its Scene, followed by the all-important Node class. Nodes share a wealth of properties that let you manipulate graphical objects in a consistent way.

Nodes specialize into different types: there are nodes that are Shapes, nodes for grouping and layout, or developer’s can define their own nodes. Shapes come in all forms: Circle, Polygon, Line, and even Path—a shape that lets you describe your own Shape.

JavaFX graphical objects also include user interface components. We cover these in the next chapter.

What You Will Learn

•   Top-level JavaFX ...

Get Essential JavaFX™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.