Package javax.swing

Examples of javax.swing.JToggleButton.addActionListener()


      }
      public void actionPerformed(ActionEvent e) {
        // this is the button to be shown when we press the list item
        JToggleButton button = new JToggleButton(((dto.getIcon()==null)?(iconController.getChangeNodeTypeIcon()):(dto.getIcon())));
        button.setToolTipText(dto.getDescription());
        button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            netWindow.getGraphPane().setAction(GraphAction.ADD_PLUGIN_NODE, dto);
          }
        });
       
View Full Code Here


  public static JToggleButton makeJToggleButton(String name, String image, ActionListener al) {
    JToggleButton button = new JToggleButton(name, makeImageIcon(image.length() == 0 ? name : image));
    button.setToolTipText(name);
    button.setBorder(null);
    button.addActionListener(al);
    return button;
  }

  public static void setColumnSizes(JTable table, TableModel model, int columns[]) {
    for (int i = 0; i < columns.length; i++) {
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String command = getResourceString(prefix + ".command");
    button.setActionCommand(command);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(AppCommand.getCommand(command), button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String actionCommand = getResourceString(prefix + ".command");
    button.setActionCommand(actionCommand);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(actionCommand, button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String command = getResourceString(prefix + ".command");
    button.setActionCommand(command);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(AppCommand.getCommand(command), button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

    JToggleButton button = new JToggleButton(
      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    String command = getResourceString(prefix + ".command");
    button.setActionCommand(command);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(AppCommand.getCommand(command), button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

      IconLoader.getInstance().getIcon(getResourceString(prefix + ".icon")));
    button.setMargin(new Insets(1, 1, 1, 1));
    button.setFocusable(false);
    String actionCommand = getResourceString(prefix + ".command");
    button.setActionCommand(actionCommand);
    button.addActionListener(this);
    toolbar.add(button);
    button.setToolTipText(getResourceString(prefix + ".tooltip"));
    buttonMap.put(actionCommand, button);
    if (aButtonGroup != null) {
      aButtonGroup.add(button);
View Full Code Here

    cardPanel.add(component, magicKey);

    final JToggleButton toggleButton = new JToggleButton(title, icon);
    toggleButton.setHorizontalTextPosition(JToggleButton.CENTER);
    toggleButton.setVerticalTextPosition(JToggleButton.BOTTOM);
    toggleButton.addActionListener(new SelectPanelAction(magicKey));

    panelButtons.add(toggleButton);
    settingsButtons.add(toggleButton);

    final JPanel helperPanel = new JPanel(new BorderLayout());
View Full Code Here

                XAccessibleStateSet aChildStateSet = mxContext.getAccessibleStateSet();
                aChild.setSelected (aChildStateSet!=null
                    && aChildStateSet.contains(AccessibleStateType.SELECTED));

                aChild.addActionListener (this);
                maChildrenSelector.add (aChild);
               
            }
            catch (IndexOutOfBoundsException e)
            {
View Full Code Here

                    XAccessibleStateSet aChildStateSet =
                        mxContext.getAccessibleStateSet();
                    aChild.setSelected (aChildStateSet!=null
                        && aChildStateSet.contains(AccessibleStateType.SELECTED));
                   
                    aChild.addActionListener (this);
                    maChildrenSelector.add (aChild);
                   
                }
                catch (IndexOutOfBoundsException 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.