A service may supply lots of these user interface factories, each capable of creating a different user interface object. This allows for the differing capabilities of viewing devices, or even for different user preferences. One user may always like a Webstyle interface, another may be content with an AWT interface, a third may want the accessibility mechanisms possible with a Swing interface, and so on.
The set of proposed factories currently includes the following:
These factories are all defined as interfaces. An implementation will define a getXXX() method that will return a user interface object. The current set of factories returns objects that belong to the Swing or AWT classes. Factories added in later iterations of the specification may return objects belonging to other user interface styles, such as speech objects. Although an interface may specify that a method, such as getJFrame() , will return a JFrame , an implementation will in fact return a subclass of this, which also implements a role interface.