27.1 Introduction

[Note: JavaFX (Chapters 12, 13 and 22) is Java’s GUI, graphics and multimedia API of the future. This chapter is provided as is for those still interested in Swing GUIs.]

In this chapter, we overview several of Java’s capabilities for drawing two-dimensional shapes, controlling colors and controlling fonts. Part of Java’s initial appeal was its support for graphics that enabled programmers to visually enhance their applications. Java contains more sophisticated drawing capabilities as part of the Java 2D API (presented in this chapter) and its successor technology JavaFX (presented in Chapter 12 and two online chapters). This chapter begins by introducing many of Java’s original drawing capabilities. Next we present several ...

Get Java How to Program, Early Objects, 11th 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.