Example usage for javax.swing JCheckBoxMenuItem setFont

List of usage examples for javax.swing JCheckBoxMenuItem setFont

Introduction

In this page you can find the example usage for javax.swing JCheckBoxMenuItem 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.stack.EventManager.java

/**
 * Create an instance of MEventManager by reading a file
 * //from   w w  w. j a va2 s  .c o m
 * @since 0.31 graphical representation of phases for both players
 */
public static void init() {
    MPhase.optionsMenu = new JPopupMenu();
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(LanguageManager.getString("breakpoint"),
            new javax.swing.ImageIcon(IdConst.IMAGES_DIR + "breakpoint.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("breakpoint.tooltip"));
    item.setMnemonic('b');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setBreakpoint(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });
    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhase"), UIHelper.getIcon("skipall1.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhase.tooltip"));
    item.setMnemonic('l');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipAll(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });
    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhaseOnce"), UIHelper.getIcon("skipall2.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhaseOnce.tooltip") + "<br><br>"
            + MagicUIComponents.HTML_ICON_TIP + LanguageManager.getString("skipPhaseOnceTTtip"));
    item.setMnemonic('o');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipAllTmp(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });

    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhaseMedium"),
            UIHelper.getIcon("skipallm2.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhaseMedium.tooltip") + "<br>"
            + MagicUIComponents.HTML_ICON_WARNING + LanguageManager.getString("skipPhaseAllTTwarn"));
    item.setMnemonic('m');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipMedium(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });
    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhaseMediumOnce"),
            UIHelper.getIcon("skipallm.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhaseMediumOnce.tooltip") + "<br>"
            + MagicUIComponents.HTML_ICON_WARNING + LanguageManager.getString("skipPhaseAllTTwarn"));
    item.setMnemonic('p');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipMediumTmp(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });

    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhaseAll"), UIHelper.getIcon("skipall3.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhaseAll.tooltip") + "<br>"
            + MagicUIComponents.HTML_ICON_WARNING + LanguageManager.getString("skipPhaseAllTTwarn"));
    item.setMnemonic('u');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipAllVery(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });
    MPhase.optionsMenu.add(item);
    item = new JCheckBoxMenuItem(LanguageManager.getString("skipPhaseAllOnce"),
            UIHelper.getIcon("skipall4.gif"));
    item.setFont(MToolKit.defaultFont);
    item.setToolTipText("<html>" + LanguageManager.getString("skipPhaseAllOnce.tooltip") + "<br>"
            + MagicUIComponents.HTML_ICON_WARNING + LanguageManager.getString("skipPhaseAllTTwarn"));
    item.setMnemonic('t');
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            MPhase.triggerPhase.setSkipAllVeryTmp(((JCheckBoxMenuItem) evt.getSource()).isSelected());
            MPhase.triggerPhase.repaint();
        }
    });
    MPhase.optionsMenu.add(item);
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.AnnotationDataUI.java

/**
 * Creates a menu item.//from   ww  w  .  j  ava  2 s .  c o m
 * 
 * @param index The index associated to the item.
 * @return See above.
 */
private JCheckBoxMenuItem createMenuItem(int index) {
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(NAMES[index]);
    Font f = item.getFont();
    item.setFont(f.deriveFont(f.getStyle(), f.getSize() - 2));
    item.setSelected(filter == index);
    item.addActionListener(this);
    item.setActionCommand("" + index);
    return item;
}