Example usage for javax.swing JRadioButtonMenuItem setFont

List of usage examples for javax.swing JRadioButtonMenuItem setFont

Introduction

In this page you can find the example usage for javax.swing JRadioButtonMenuItem setFont.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.")
public void setFont(Font font) 

Source Link

Document

Sets the font for this component.

Usage

From source file:net.sf.firemox.AbstractMainForm.java

/**
 * Initialize the components of this form.
 *//*from  w  w  w.  jav a 2s .  c  om*/
protected void initAbstractMenu() {
    // "TBS" menu
    tbsMenu = UIHelper.buildMenu("menu_options_tbs");
    ButtonGroup group4 = new ButtonGroup();
    final MdbListener mdbListener = new MdbListener(this);
    final File[] mdbs = MToolKit.getFile(IdConst.TBS_DIR)
            .listFiles((FileFilter) FileFilterUtils.suffixFileFilter("xml"));
    String defaultTbs = MToolKit.tbsName;
    for (File mdb : mdbs) {
        String mdbName = FilenameUtils.getBaseName(mdb.getName());
        JRadioButtonMenuItem itemChck = new JRadioButtonMenuItem();
        MToolKit.tbsName = mdbName;
        updateMdbMenu(mdbName, itemChck);
        itemChck.setActionCommand(mdbName);
        itemChck.setFont(MToolKit.defaultFont);
        itemChck.addActionListener(mdbListener);
        group4.add(itemChck);
        tbsMenu.add(itemChck);
        if (mdbName.equals(defaultTbs)) {
            itemChck.setSelected(true);
        }
    }
    MToolKit.tbsName = defaultTbs;
    tbsMenu.add(new JSeparator());

    // "More TBS" menu item
    tbsMenu.add(UIHelper.buildMenu("menu_options_tbs_more", mdbListener));
    tbsMenu.add(new JSeparator());
    final JMenuItem updateMdbMenu = UIHelper.buildMenu("menu_options_tbs_update", mdbListener);
    updateMdbMenu.setEnabled(false);
    tbsMenu.add(updateMdbMenu);
    tbsMenu.add(UIHelper.buildMenu("menu_options_tbs_rebuild", mdbListener));
    optionMenu.add(new JSeparator());
    optionMenu.add(tbsMenu);
}