Package javax.swing

Examples of javax.swing.AbstractButton.addActionListener()


      _exportDirPanel.add(exportDirLabel, "1, 1, 1, 1");
      _exportDirPanel.add(getExportDirTextField(), "3, 1, 3, 1");

      final AbstractButton browseButton = new JButton("Browse");
      browseButton.setPreferredSize(new Dimension(80, 20));
      browseButton.addActionListener(new FileChooserActionListener());
      _exportDirPanel.add(browseButton, "5, 1, 5, 1");

      _exportDirPanel.add(getExportDirFormatCheckbox(), "1, 3, 1, 3");
      _exportDirPanel.add(new JLabel("Create archive sub dir(s) in the following format (MM_TT_YYYY)"), "3, 3, 3, 3");
    }
View Full Code Here


    public void addTab(String title, Icon icon, ActionListener listener) {
        AbstractButton button = MacButtonFactory.makePreferencesTabBarButton(
                new JToggleButton(title, icon));
        fButtonGroup.add(button);
        button.addActionListener(listener);

        fPreferencesTabBar.addComponentToLeft(button);
    }

    public void showTab(String title) {
View Full Code Here

        if( closable ) {
            view.addAction( View.CLOSE_ACTION );
            // TODO fix this: this is the only way I found to find out if a dockable has
            // been closed by the user.
            AbstractButton btn = view.getActionButton( View.CLOSE_ACTION );
            btn.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    close( component );
                }
            } );
        }
View Full Code Here

  private AbstractButton createToggleButton(Icon icon, String command, String tt) {
    AbstractButton button;
    button = new JToggleButton("", icon);
    button.setMargin(new Insets(0, 0, 0, 0));
    button.setActionCommand(command);
    button.addActionListener(this);
    if (tt != null) {
      button.setToolTipText(tt);
    }
    return button;
  }
View Full Code Here

          }

          b.setSelected(true);

          for (ActionListener listener : listeners) {
            b.addActionListener(listener);
          }
        }
      }
    }
  }
View Full Code Here

                continue;
            }

            AbstractButton item = groups.add(groupValue);
            item.setIcon(emptyIcon);
            item.addActionListener(groupListener);
            item.putClientProperty("index", i);
        }

        editMenu.add(groups);
View Full Code Here

                continue;
            }

            AbstractButton item = sort.add(sortValue);
            item.setIcon(emptyIcon);
            item.addActionListener(sortListener);
            item.putClientProperty("index", i);
        }

        editMenu.add(sort);
        editMenu.addSeparator();
View Full Code Here

        };

        final ButtonGroup gr = new ButtonGroup();
        for (PlaybackOrder.Order o : PlaybackOrder.Order.values()) {
            JCheckBoxMenuItem item = new JCheckBoxMenuItem(o.toString());
            item.addActionListener(orderListener);
            item.putClientProperty("order", o.ordinal());
            gr.add(item);
            orderMenu.add(item);
        }
View Full Code Here

                        //Build button
                        Icon icon = u.getIcon();
                        DecoratedIcon decoratedIcon = getDecoratedIcon(icon, t);
                        JToggleButton btn = new JToggleButton(decoratedIcon);
                        btn.setToolTipText(u.getDisplayName());
                        btn.addActionListener(new ActionListener() {

                            @Override
                            public void actionPerformed(ActionEvent e) {
                                model.setCurrentTransformer(t);
                            }
View Full Code Here

    }

    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

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.