Package javax.swing

Examples of javax.swing.JCheckBoxMenuItem.addActionListener()


        final JMenu optionsMenu = new JMenu(Messages.getString("ClientFrame.80")); //$NON-NLS-1$
        optionsMenu.setMnemonic(KeyEvent.VK_O);
        menubar.add(optionsMenu);
       
        JCheckBoxMenuItem check = new JCheckBoxMenuItem(Messages.getString("ClientFrame.81"), "yes".equals(properties.getProperty(OutputKeys.INDENT))); //$NON-NLS-1$
        check.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                properties.setProperty(OutputKeys.INDENT,
                        ((JCheckBoxMenuItem) e.getSource()).isSelected()
                        ? "yes" //$NON-NLS-1$
View Full Code Here


            }
        });
        optionsMenu.add(check);
       
        check = new JCheckBoxMenuItem(Messages.getString("ClientFrame.85"), "yes".equals(properties.getProperty(EXistOutputKeys.EXPAND_XINCLUDES))); //$NON-NLS-1$
        check.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(final ActionEvent e) {
                properties.setProperty(EXistOutputKeys.EXPAND_XINCLUDES,
                        ((JCheckBoxMenuItem) e.getSource()).isSelected()
                        ? "yes" //$NON-NLS-1$
View Full Code Here

    // Auto-Discovery
    final JCheckBoxMenuItem autodiscoveryItem = new JCheckBoxMenuItem("Auto Discover");
    autodiscoveryItem.setMnemonic(KeyEvent.VK_A);
    autodiscoveryItem.setSelected(true);
    gridNodeMenu.add(autodiscoveryItem);
    autodiscoveryItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        autodiscover = autodiscoveryItem.isSelected();
      }
    });
    addUIElement("menu.node.autodiscover", autodiscoveryItem)// Add to components map
View Full Code Here

  }

  JCheckBoxMenuItem createCheckboxMenuItem(JMenu menu, String name, String action, char mnemonic, KeyStroke ks) {
    JCheckBoxMenuItem ret;
    ret = new JCheckBoxMenuItem(name);
    ret.addActionListener(this);
    ret.setActionCommand(action);
    ret.setMnemonic(mnemonic);
    menu.add(ret);
    if (ks != null)
      ret.setAccelerator(ks);
View Full Code Here

        m_menuOptions.removeAll();
       
        final JCheckBoxMenuItem antialias =
            new JCheckBoxMenuItem( "Antialias", m_frame.isAntialias() );
        antialias.setMnemonic( 'a' );
        antialias.addActionListener( new ActionListener()
            {
                public void actionPerformed( ActionEvent event )
                {
                    m_frame.setAntialias( antialias.getState() );
                }
View Full Code Here

    toolMenu.add(g.a_learnCPT);
    toolMenu.addSeparator();
    toolMenu.add(g.a_layout);
    toolMenu.addSeparator();
    final JCheckBoxMenuItem viewMargins = new JCheckBoxMenuItem("Show Margins", false);
    viewMargins.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        boolean bPrev = g.m_bViewMargins;
        g.m_bViewMargins = viewMargins.getState();
        if (bPrev == false && viewMargins.getState() == true) {
          g.updateStatus();
View Full Code Here

        g.repaint();
      }
    });
    toolMenu.add(viewMargins);
    final JCheckBoxMenuItem viewCliques = new JCheckBoxMenuItem("Show Cliques", false);
    viewCliques.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        boolean bPrev = g.m_bViewCliques;
        g.m_bViewCliques = viewCliques.getState();
        if (bPrev == false && viewCliques.getState() == true) {
          g.updateStatus();
View Full Code Here

        UIManager.LookAndFeelInfo[] lookAndFeelInfos = UIManager.getInstalledLookAndFeels();
        for (UIManager.LookAndFeelInfo lookAndFeelInfo : lookAndFeelInfos) {
            JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(lookAndFeelInfo.getName(),
                    UIManager.getLookAndFeel().getName().equalsIgnoreCase(lookAndFeelInfo.getName()));
            menuItem.setActionCommand(lookAndFeelInfo.getClassName());
            menuItem.addActionListener(new ActionListener() {

                public void actionPerformed(final ActionEvent e) {
                    try {
                        UIManager.setLookAndFeel(e.getActionCommand());
                        updateUI(e.getActionCommand());
View Full Code Here

      if (withDefaults) {
        /* Create default menu items */
        final JMenuItem hideNormalMenuItem = new JCheckBoxMenuItem("Hide normal output");
        hideNormalMenuItem.setEnabled(true);
        hideNormalMenuItem.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            MessageList.this.hideNormal = hideNormalMenuItem.isSelected();
            ((MessageModel)getModel()).updateList();
          }
        });
View Full Code Here

    logTextArea.setMargin(new Insets(5,5,5,5));
    logTextArea.setEditable(true);
    logTextArea.setCursor(null);

    final JCheckBoxMenuItem activateMenuItem = new JCheckBoxMenuItem("Activate");
    activateMenuItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ev) {
        try {
          setScriptActive(!isActive());
        } catch (Exception e) {
          logger.fatal("Error: " + e.getMessage(), e);
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.