Package javax.swing

Examples of javax.swing.AbstractButton.addActionListener()


    }

    private static Component option2Button(Object option, NotifyDescriptor nd, ActionListener l, JRootPane rp) {
        if (option instanceof AbstractButton) {
            AbstractButton b = (AbstractButton) option;
            b.addActionListener(l);

            return b;
        } else if (option instanceof Component) {
            return (Component) option;
        } else if (option instanceof Icon) {
View Full Code Here


                rp.setDefaultButton(b);
            }

            // added a simple accessible name to buttons
            b.getAccessibleContext().setAccessibleName(text);
            b.addActionListener(l);

            return b;
        }
    }
}
View Full Code Here

   
    b      = Box.createHorizontalBox();
    ggPlus    = new ModificationButton( ModificationButton.SHAPE_PLUS );
    ggMinus    = new ModificationButton( ModificationButton.SHAPE_MINUS );
    ggMinus.setEnabled( false );
    ggPlus.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent e )
      {
//        int row = table.getSelectedRow() + table.getSelectedRowCount();
//        if( row <= 0 ) row = collConfigs[ ID ].size();
        final int modelIndex = collConfigs[ id ].size();
View Full Code Here

    toolbar.add(comp, null, toolbar.getComponentCount()-1);
    buttonsFrame.pack();

    if(comp instanceof AbstractButton) {
      final AbstractButton ab = (AbstractButton) comp;
      ab.addActionListener(this);
    }

    attachAddedComponent(comp);
  }
View Full Code Here

    protected void registerComponent(JComponent component) {
        if (component instanceof AbstractButton) {
            AbstractButton abstractButton = (AbstractButton) component;
            if (actionListener == null) actionListener = createActionListener();
            abstractButton.addActionListener(actionListener);
        }
        else if (component instanceof CheckBoxList) {
            CheckBoxList checkBoxList = (CheckBoxList) component;
            if (actionListener == null) actionListener = createActionListener();
            checkBoxList.addActionListener(actionListener);
View Full Code Here

    closeButton.setRolloverEnabled(false);
    closeButton.setRolloverIcon(GuiResources.CLOSE_EDITOR_HOVER_ICON);
    closeButton.setRolloverSelectedIcon(GuiResources.CLOSE_EDITOR_HOVER_ICON);
    closeButton.setPressedIcon(GuiResources.CLOSE_EDITOR_HOVER_ICON);
   
    closeButton.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        release();
        _delegate.add(NO_BUG_SELECTED_LABEL, BorderLayout.CENTER);
        final Dimension preferredSize = NO_BUG_SELECTED_LABEL.getPreferredSize();
        preferredSize.width = _delegate.getPreferredSize().width;
View Full Code Here

        @Override
        public boolean isEnabled() {
          return super.isEnabled() && _excludeList.getSelectedIndex() > -1;
        }
      };
      removeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
          final int index = _excludeList.getSelectedIndex();
          getModel(_excludeList).remove(index);
          _preferences.removeExcludeFilter(index);
View Full Code Here

        @Override
        public boolean isEnabled() {
          return super.isEnabled() && _baselineList.getSelectedIndex() > -1;
        }
      };
      removeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
          final int index = _baselineList.getSelectedIndex();
          getModel(_baselineList).remove(index);
          _preferences.removeBaselineExcludeFilter(index);
View Full Code Here

    c.weightx = 1;
    c.gridwidth = 1;
    add(_importFile, c);

    final AbstractButton browseButton = new JButton("Browse");
    browseButton.addActionListener(new MyFileChooserActionListener());
    c.weightx = 0;
    add(browseButton, c);

    c.gridx = GridBagConstraints.RELATIVE;
    c.gridy = 2;
View Full Code Here

      final String longText = plugin.getDetailedDescription();
      if (longText != null) {
        checkbox.setToolTipText("<html>" + longText + "</html>");
      }
      checkbox.setSelected(isSelected(currentProject, plugin, userPlugin));
      checkbox.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          if (checkbox.isSelected()) {
            if (userPlugin) {
              _preferences.addUserPlugin(pluginUrl, pluginId, true);
            } else {
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.