Package javax.swing

Examples of javax.swing.JMenuItem.addItemListener()


    JMenuItem menuBarCheckBoxMenuItem = new JCheckBoxMenuItem("菜单栏(M)", true);
   
    menuBarCheckBoxMenuItem.setIcon(IconUtils.createImageIcon(ICON_CLASS_PATH + "tick.png"));
    menuBarCheckBoxMenuItem.setMnemonic('M');
    menuBarCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke('M', Event.CTRL_MASK, false));
    menuBarCheckBoxMenuItem.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == ItemEvent.SELECTED) {
          getJMenuBar().setVisible(true);
        } else {
          getJMenuBar().setVisible(false);
View Full Code Here


      JCheckBoxMenuItem jcmi = new JCheckBoxMenuItem(entry);
      jm = jcmi;
      jcmi.setState(state);
    }
    jm.setSelected(state);
    jm.addItemListener(cmil);
    jm.setActionCommand(basename);
    updateButton(jm, entry, basename);
    jm.setName(id == null ? ((Component) menu).getName() + "." : id);
    addToMenu(menu, jm);
    return jm;
View Full Code Here

        menuItem = new JMenuItem( WORD_XRF );
        menuItem.setMnemonic( KeyEvent.VK_W );
        menuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_W, ActionEvent.ALT_MASK ) );
        menuItem.addActionListener( this );
        menuItem.addItemListener( this );
        menu.add( menuItem );

        menu.addSeparator();

        ButtonGroup group = new ButtonGroup();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.