Home

Component reference

Component reference

Let's look at the scala.swing.Component class in some more detail. As we have seen, its state can be accessed and modified through attributes that look like fields (but of course they are implemented as methods, since setting the attribute causes a change in the look of the component).

The most important attributes are listed below. Note that all classes that can be used as components, such as scala.swing.Label, scala.swing.TextField, scala.swing.Button, as well as our own components, extend the scala.swing.Component class, and therefore have these same attributes.