The JFC Swing Tutorial: A Guide to Constructing GUIs (2nd Edition)
< Day Day Up > |
http://java.sun.com/docs/books/tutorial/uiswing/14painting/index.html You might not need to read this chapter at all. Many programs get by with no custom painting. If they display images, they do so using icons in standard Swing components such as labels and buttons . To display styled text, perhaps with embedded images and components, they use text components. To customize the edges of components, they use borders. To change the look of all components, they use a customizable look and feel, such as the GTK+ look and feel. If you can't find a way to make a component look the way you want it to, then read on. This chapter introduces painting concepts, as they apply to Swing components, and then refers you elsewhere so you can write painting code that makes your custom components look great. This chapter contains the following sections:
If you run into any problems, you should consult the section Solving Common Painting Problems (page 740) in the Appendix. How Swing Components Are Displayed How Painting Happens The Swing Painting Methods An Example of Painting Repainting Transparent Components Introduction to Painting Concepts The Coordinate System The Graphics Object and Graphics2D Implementing a Custom Component An Example of Custom Painting Summary Questions and Exercises Example Programs |
< Day Day Up > |