5.4 Graphics Supplement

The whole is more than the sum of its parts.

—PROVERB

Now that we have explained methods and parameters more completely, we will revisit material from the previous graphics supplements to give more detailed explanations. We will

  • Explain the GraphicsContext class and the structure of a JavaFX application more completely.

  • Use methods to rewrite one of our previous graphics applications in a cleaner way.

  • Introduce some additional drawing methods.

The GraphicsContext Class

A JavaFX application uses the metaphor of a stage and scenes, just like the stage and scene of a theater. The Stage class is a top-level JavaFX container and in our examples will correspond to a window. Every Stage has an associated Scene object. The ...

Get Java: An Introduction to Problem Solving and Programming, 8th Edition 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.