Deprecated Methods

Table 11-2 purposely leaves out deprecated methods from the original AWT. Many component methods in the original version of the AWT were named inconsistently. For example, to get the font associated with a component, you would invoke getFont(); however, to get the bounds of a component, you would invoke bounds(). As a result, it was difficult to remember which methods were preceded with get/set and which were not. Fortunately, the 1.1 release of the AWT remedied the inconsistent naming, and as a result many of the old methods are now deprecated, meaning they will no longer be supported in subsequent releases of the AWT. In fact, javac comes with a -deprecation option, which issues warnings when a deprecated method is used. ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.