Component Visibility and Responsiveness

All components, other than frames, windows, and dialogs,[3] are visible by default. You can use the The setVisible method from java.awt.Component may be used to set the visibility of individual components. If you need to toggle the visibility of a set of components, you should consider using the CardLayout layout manager—see “The CardLayout Layout Manager”—instead of individually managing the visibility of each component.

[3] Invoking setVisible(true) on frames, windows, and dialogs makes them visible.

You can also toggle a component's responsiveness to user input by invoking the setEnabled method, passing either true or false to enable or disable, respectively, a component's responsiveness to user input. ...

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.