Book contents
- Frontmatter
- Contents
- Preface
- Acknowledgements
- Part I Introduction to Java
- 1 Introduction
- 2 Language basics
- 3 Classes and objects in Java
- 4 More about objects in Java
- 5 Organizing Java files and other practicalities
- 6 Java graphics
- 7 Graphical User Interfaces
- 8 Threads
- 9 Java input/output
- 10 Java utilities
- 11 Image handling and processing
- 12 More techniques and tips
- Part II Java and the network
- Part III Out of the sandbox
- Appendix 1 Language elements
- Appendix 2 Operators
- Appendix 3 Java floating-point
- Index
- References
6 - Java graphics
Published online by Cambridge University Press: 08 January 2010
- Frontmatter
- Contents
- Preface
- Acknowledgements
- Part I Introduction to Java
- 1 Introduction
- 2 Language basics
- 3 Classes and objects in Java
- 4 More about objects in Java
- 5 Organizing Java files and other practicalities
- 6 Java graphics
- 7 Graphical User Interfaces
- 8 Threads
- 9 Java input/output
- 10 Java utilities
- 11 Image handling and processing
- 12 More techniques and tips
- Part II Java and the network
- Part III Out of the sandbox
- Appendix 1 Language elements
- Appendix 2 Operators
- Appendix 3 Java floating-point
- Index
- References
Summary
Introduction
Java's graphics capability has always been a leading feature of the language. The Java designers clearly expected the graphical user interface (GUI) to dominate interactions with Java programs on all but the smallest platforms. Java appeared at the start of the Internet boom and applets were expected to bring interactivity to the browser. Many thought that Java would also quickly become popular for standalone client applications on platforms with graphical operating systems.
In Java 1.0, however, the graphical elements provided for workable interfaces but they appeared crude compared to platform-specific graphics developed with other languages. The goal of portability had led to a lowest common denominator approach that was not very pretty. This became one of the main stumbling blocks that prevented Java from becoming a popular language for desktop applications.
However, with the inclusion of the Swing packages in version 1.2, Java graphics took a huge leap forward in visual appeal and in the breadth and depth of its features. With subsequent versions, Java graphics continued to improve and now compares quite well with that available with any other programming language and still provides for relatively easy portability.
In this chapter we introduce Java graphics starting with a quick overview of the Abstract Windowing Toolkit from Java 1.0. We then look at the Java Foundation Classes system, also known as “Swing,” in some detail. We wait until Chapter 7 to discuss how to bring interactivity to the user interface.
- Type
- Chapter
- Information
- Publisher: Cambridge University PressPrint publication year: 2005