|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXRadioGroup<T>
public class JXRadioGroup<T>
A group of radio buttons that functions as a unit.
Notes
(1) Enabling and disabling the JXRadioGroup will enable/disable all of the
child buttons inside the JXRadioGroup.
(2) If the generic type parameter of JXRadioGroup is a subclass of AbstractButton
, then
the buttons will be added "as is" to the container.
If the generic type is anything else, buttons will be created as JRadioButton
objects,
and the button text will be set by calling toString() on the value object.
(3) Alternatively, if you want to configure the buttons individually, construct the JXRadioGroup
normally, and then call getChildButton(int)
or getChildButton(Object)
and configure the buttons.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JXRadioGroup()
Create a default JXRadioGroup with a default layout axis of BoxLayout.X_AXIS . |
|
JXRadioGroup(T[] radioValues)
Create a default JXRadioGroup with a default layout axis of BoxLayout.X_AXIS . |
Method Summary | ||
---|---|---|
void |
add(T radioValue)
You can use this method to manually add your own AbstractButton objects, provided you declared the class as JXRadioGroup<JRadioButton> . |
|
void |
addActionListener(ActionListener l)
|
|
static
|
create(T[] radioValues)
Convenience factory method. |
|
protected void |
fireActionEvent(ActionEvent e)
|
|
ActionListener[] |
getActionListeners()
|
|
AbstractButton |
getChildButton(int index)
Retrieve the child button by index. |
|
AbstractButton |
getChildButton(T value)
Retrieve the child button that represents this value. |
|
int |
getChildButtonCount()
Get the number of child buttons. |
|
AbstractButton |
getSelectedButton()
|
|
T |
getSelectedValue()
|
|
void |
removeActionListener(ActionListener l)
|
|
void |
setEnabled(boolean enabled)
Enable/disable all of the child buttons |
|
void |
setLayoutAxis(int axis)
Set the layout axis of the radio group. |
|
void |
setSelectedValue(T value)
|
|
void |
setValues(T[] radioValues)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JXRadioGroup()
BoxLayout.X_AXIS
.
public JXRadioGroup(T[] radioValues)
BoxLayout.X_AXIS
.
radioValues
- the list of values used to create the group.Method Detail |
---|
public void setLayoutAxis(int axis)
axis
- values from BoxLayout
.public static <T> JXRadioGroup<T> create(T[] radioValues)
radioValues
- the list of values used to create the group.public void setValues(T[] radioValues)
public void add(T radioValue)
JXRadioGroup<JRadioButton>
.
public AbstractButton getSelectedButton()
public T getSelectedValue()
public void setSelectedValue(T value)
public AbstractButton getChildButton(int index)
public AbstractButton getChildButton(T value)
public int getChildButtonCount()
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
public ActionListener[] getActionListeners()
protected void fireActionEvent(ActionEvent e)
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
enabled
- true if this component should be enabled, false otherwiseJComponent.setEnabled(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |