Chapter 10. Graphics and user interfaces

Graphics and user interfaces

10.1 Introduction to the awt and Swing

10.2 Putting graphics in a window

10.3 Laying out a GUI

Introduction to the awt and Swing

The real world has been converted to wysiwyg [1] and GUI [2] interfaces, and Java is fully equipped to provide these options. The GUI part is provided inside two packages called java.awt – abstract windowing toolkit – and javax.swing. From now on we will call them the awt (pronounced ‘ought’) package and Swing, and know that they are Java’s platform-independent approach to user interfacing.

These packages are also completely driven from within the Java language. That means that any graphical ...

Get Java Gently, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.