AWT and Swing


Introduction

This chapter assumes the reader has had no experience with GUI (Graphical User Interface) programming. It describes the computer screen’s coordinate system, how to create windows, how to create different graphical components and how to organize them into windows and containers. It does not describe all aspects of Swing programming, as that would require an entire book in itself. Instead, it concentrates on the basics, and attempts to give a solid foundation upon which the reader can build. This chapter is the basis for the next chapter on events and culminates in a moderately complex interface. It is left to the next chapter to add event handling logic, turning this interface into a fully interactive program.

When I am learning a new computer technology, I like to test out concepts early in the learning process by coding and seeing the results. Often, I like to see it “happen” even before I understand it all. Something about seeing it happen gives me added inspiration to learn the details. So, on the assumption that what I like must be what you like, this chapter takes a hands-on approach to learning. We will create several tiny GUI applications as we learn. Certain concepts will be discussed formally only after we have coded and played with them a bit.

We have a lot of ground to cover, so after you have compiled and run each application, I strongly encourage you to consult the javadocs for additional ideas and information. You are also encouraged to change the code experimentally and observe the results. The final portion of this chapter might seem overwhelming unless you have become quite comfortable with the sections that precede it.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net