| Package | Description | 
|---|---|
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | DefaultButtonModel The default implementation of a  Buttoncomponent's data model. | |
| static class  | JToggleButton.ToggleButtonModel The ToggleButton model | 
| Modifier and Type | Field | Description | 
|---|---|---|
| protected ButtonModel  | AbstractButton. model The data model that determines the button's state. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| ButtonModel  | AbstractButton. getModel ()Returns the model that this button represents. | |
| ButtonModel  | ButtonGroup. getSelection ()Returns the model of the selected button. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| boolean | ButtonGroup. isSelected (ButtonModel m)Returns whether a  ButtonModelis selected. | |
| void | JMenuItem. setModel (ButtonModel newModel)Sets the model that this button represents. | |
| void | JMenu. setModel (ButtonModel newModel)Sets the data model for the "menu button" -- the label
 that the user clicks to open or close the menu. | |
| void | AbstractButton. setModel (ButtonModel newModel)Sets the model that this button represents. | |
| void | ButtonGroup. setSelected (ButtonModel m,
 boolean b)Sets the selected value for the  ButtonModel. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy. 
Scripting on this page tracks web page traffic, but does not change the content in any way.