O'Reilly logo

Ivor Horton's Beginning Java™ 2, JDK™ 5th Edition by Ivor Horton

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 19. Drawing in a Window

In this chapter you'll look at how you can draw using the Java 2D facilities that are part of the Java Foundation Classes (JFC). You'll explore how you draw in an applet and in an application. You'll investigate how you can combine the event-handling capability that you learned about in the previous chapter with the drawing facilities you'll explore in this chapter to implement an interactive graphical user interface for creating a sketch.

By the end of this chapter you will have learned:

  • What components are available for creating a GUI

  • How coordinates are defined for drawing on a component

  • How you implement drawing on a component

  • How to structure the components in a window for drawing

  • What kinds of shapes you can draw on a component

  • How you implement mouse listener methods to enable interactive drawing operations

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