O'Reilly logo

Learn JavaFX 8: Building User Experience and Interfaces with Java 8 by Kishori Sharan

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

CHAPTER 17

image

Understanding 2D Shapes

In this chapter, you will learn:

  • What 2D shapes are and how they are represented in JavaFX
  • How to draw 2D shapes
  • How to draw complex shapes using the Path class
  • How to draw shapes using the Scalable Vector Graphics (SVG)
  • How to combine shapes to build another shape
  • How to use strokes for a shape
  • How to style shapes using Cascading Style Sheets (CSS)

What Are 2D Shapes?

Any shape that can be drawn in a two-dimensional plane is called a 2D shape. JavaFX offers variety nodes to draw different types of shapes (lines, circles, rectangles, etc.). You can add shapes to a scene graph.

Shapes can be two-dimensional or ...

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