Reading this Book
We’re well aware that most readers don’t read the
Preface. You have our permission to skip it, provided that you look
at the Conventions section. That section is particularly important
because in this book, we’re experimenting with a few new
techniques for explaining the Swing classes. As we said earlier,
everything in Swing is a Java Bean. This means that much of an
object’s behavior is controlled by a set of properties, which
are manipulated by accessor methods. For example, the property
color would be accessed by the methods
getColor() (to find out the color) and
setColor() (to change the color). If a property
has a boolean value, the get method is often replaced by an is
method; for example, the visible property would
have methods isVisible() and
setVisible().
We found the idea of properties very powerful in helping us
understand Swing. Therefore, rather than listing all of a
class’s accessor methods, we decided to present a table for
each class, listing the class’s properties and showing the
property’s data type, which accessor methods are present,
whether the property is “bound” (i.e., changing the
property generates a PropertyChangeEvent), and the property’s default value. This approach certainly saves paper (you didn’t really want a 2000 page book, did you?) and should make it easier to understand what a component does and how it is structured. Furthermore, if you’re not already in the habit of thinking in terms of the JavaBeans architecture, you should ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access