Package javax.swing

Examples of javax.swing.JButton.doClick()


        {
            public void actionPerformed(ActionEvent rew)
            {
                OPENUSER=sghin.isSelected();
                if(apply.isEnabled())
                    apply.doClick();
                f.dispose();
            }
        });
        cancel.addActionListener(new ActionListener()
        {
View Full Code Here


                final JButton defaultButton = rootPane.getDefaultButton();

                if (defaultButton != null && !box.isPopupVisible()) {
                    final Object selection = box.getEditor().getItem();
                    box.setSelectedItem(selection);
                    defaultButton.doClick();
                }
            }
        }
    }
View Full Code Here

            @Override
            public void run() {
                final BasicSplitPaneUI ui = (BasicSplitPaneUI) terminalSplitPane.getUI();
                final BasicSplitPaneDivider divider = ui.getDivider();
                final JButton button = (JButton) divider.getComponent(1);
                button.doClick();
            }
        });
    }

    public ClustersPanel getClustersPanel() {
View Full Code Here

    }

    private static void test(ActionListener listener) {
        JButton button = new JButton("hi");
        button.addActionListener(listener);
        button.doClick();
    }

    public void foo(Icon o) {
    }
View Full Code Here

            list.setLayoutOrientation(JList.VERTICAL);
            list.setVisibleRowCount(-1);
            list.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        setButton.doClick(); // emulate button click
                    }
                }
            });
           
            JScrollPane listScroller = new JScrollPane(list);
View Full Code Here

      // given
      JButton trigger = new JButton();
      Behavior<EventObject> behavior = mock(Behavior.class);
      perform(behavior).when(ActionListener.class).on(trigger);
      // when
      trigger.doClick();
      // then
      verify(behavior).perform(any(ActionEvent.class));
   }

   @Test
View Full Code Here

      Behavior<EventObject> behavior = mock(Behavior.class);
      Observation.ObservationRegistration<Object> on = perform(behavior).when(ActionListener.class).on(trigger);

      on.unregister();
      // when
      trigger.doClick();
      // then
      verify(behavior, Mockito.never()).perform(any(ActionEvent.class));
   }

   @Test
View Full Code Here

        /* bind the enter key */
        Action enterAction = new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                loginButton.doClick();
            }
        };
        nameTextField.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "ENTER");
        nameTextField.getActionMap().put("ENTER", enterAction);

View Full Code Here

    if (this.options.autoOpen) {
      testClassText.postActionEvent();
    }
    if (this.options.autoValidate) {
      validateAllButton.doClick();
    }
  }

  private void updateRequirementText(Object selection) {
    jexSelectionText.setText(selection instanceof AbstractRequirement ? getRequirementText((AbstractRequirement) selection) : "");
View Full Code Here

            button.setEnabled(true);
            logToConsole("Button was disabled, has been enabled: " + buttonText);
        }

        logToConsole("Click button: " + buttonText);
        button.doClick();
        if (! button.isEnabled()) logToConsole("Button now disabled: " + buttonText);
        return true;
    }

    /**
 
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.