Java Code Examples for com.sun.java.swing.action.StateChangeAction

The following examples show how to use com.sun.java.swing.action.StateChangeAction. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: TencentKona-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 2
Source Project: TencentKona-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 3
Source Project: TencentKona-8   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 4
Source Project: jdk8u60   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 5
Source Project: jdk8u60   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 6
Source Project: jdk8u60   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 7
Source Project: openjdk-jdk8u   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 8
Source Project: openjdk-jdk8u   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 9
Source Project: openjdk-jdk8u   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 10
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 11
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 12
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 13
Source Project: openjdk-jdk9   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 14
Source Project: openjdk-jdk9   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 15
Source Project: openjdk-jdk9   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 16
Source Project: hottub   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 17
Source Project: hottub   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 18
Source Project: hottub   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 19
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 20
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 21
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 22
Source Project: openjdk-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a, boolean selected)
{
    JCheckBoxMenuItem mi = new JCheckBoxMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 23
Source Project: openjdk-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a, boolean selected)
{
    JRadioButtonMenuItem mi = new JRadioButtonMenuItem(a);
    mi.addItemListener(a);
    mi.setSelected(selected);
    menu.add(mi);
    if(group != null)
        group.add(mi);
    configureToggleMenuItem(mi, a);
}
 
Example 24
Source Project: openjdk-8   Source File: CommonToolBar.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected void addToggleButton(StateChangeAction a, ButtonGroup group)
{
    JToggleButton button = new JToggleButton(a);
    button.addItemListener(a);
    button.setSelected(a.isSelected());
    if(group != null)
        group.add(button);
    add(button);
    configureToggleButton(button, a);
}
 
Example 25
Source Project: TencentKona-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a)
{
    addCheckBoxMenuItem(menu, a, false);
}
 
Example 26
Source Project: TencentKona-8   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a)
{
    addRadioButtonMenuItem(menu, group, a, false);
}
 
Example 27
Source Project: TencentKona-8   Source File: CommonToolBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addToggleButton(StateChangeAction a)
{
    addToggleButton(a, null);
}
 
Example 28
Source Project: jdk8u60   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addCheckBoxMenuItem(JMenu menu, StateChangeAction a)
{
    addCheckBoxMenuItem(menu, a, false);
}
 
Example 29
Source Project: jdk8u60   Source File: CommonMenuBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addRadioButtonMenuItem(JMenu menu, ButtonGroup group, StateChangeAction a)
{
    addRadioButtonMenuItem(menu, group, a, false);
}
 
Example 30
Source Project: jdk8u60   Source File: CommonToolBar.java    License: GNU General Public License v2.0 4 votes vote down vote up
protected void addToggleButton(StateChangeAction a)
{
    addToggleButton(a, null);
}