Examples of addActionListener()


Examples of javax.swing.ComboBoxEditor.addActionListener()

            defaultEditor.setItem(category.getName());
          }
        }

        public void addActionListener(ActionListener l) {
          defaultEditor.addActionListener(l);
        }

        public Component getEditorComponent() {
          return defaultEditor.getEditorComponent();
        }
View Full Code Here

Examples of javax.swing.DefaultButtonModel.addActionListener()

  }

  public void test(TestHarness harness)
  {
    DefaultButtonModel m = new DefaultButtonModel();
    m.addActionListener(this);
    m.addChangeListener(this);
    m.setRollover(true);
    harness.check(m.isRollover(), true);
    harness.check(lastChangeEvent.getSource(), m);
    harness.check(lastActionEvent, null);
View Full Code Here

Examples of javax.swing.JButton.addActionListener()

    panelDeleted.add(new JScrollPane(list), BorderLayout.CENTER);

    JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    ok.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        setVisible(false);
      }
View Full Code Here

Examples of javax.swing.JCheckBox.addActionListener()

      {
        editor = new TextKeyEditor(getConfig(), keyNames[i], displayName);
      }

      final JCheckBox enableCB = new JCheckBox();
      enableCB.addActionListener(new EnableAction(editor, enableCB));
      final JPanel panel = new JPanel();
      panel.setLayout(new BorderLayout());
      panel.add(enableCB, BorderLayout.WEST);
      panel.add(editor.getComponent(), BorderLayout.CENTER);
View Full Code Here

Examples of javax.swing.JCheckBoxMenuItem.addActionListener()

  private static JCheckBoxMenuItem createViewSearchMenu() {
    final JCheckBoxMenuItem showSearch = new JCheckBoxMenuItem(
        ToolBarDragAndDropSettings.mLocalizer
            .msg("showSearchField", "Show search field"));
    showSearch.setSelected(Settings.propIsSearchFieldVisible.getBoolean());
    showSearch.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        MainFrame.getInstance().setShowSearchField(showSearch.isSelected());
      }
    });
   
View Full Code Here

Examples of javax.swing.JComboBox.addActionListener()

      tempHolder.add(new JLabel("Class: "), BorderLayout.WEST);
      tempHolder.add(classCombo, BorderLayout.EAST);
      comboHolder.add(tempHolder, BorderLayout.WEST);
      add(comboHolder, BorderLayout.NORTH);
           
      classCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          int selected = classCombo.getSelectedIndex();
          if (selected >= 0) {
            for (int i = 0; i < m_plots.size(); i++) {
              m_plots.get(i).setColoringIndex(selected);
View Full Code Here

Examples of javax.swing.JFileChooser.addActionListener()

      FileSystemView file_system_view;
        file_system_view = FileSystemView.getFileSystemView();
        file_chooser = new JFileChooser( file_system_view );
        file_chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        file_chooser.setMultiSelectionEnabled(false);
        file_chooser.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            if(event.getActionCommand() == JFileChooser.APPROVE_SELECTION) { 
                  final File file = file_chooser.getSelectedFile();
                  (new JMThread(new JMRunnable() {
                   public void JMRun() {
View Full Code Here

Examples of javax.swing.JFormattedTextField.addActionListener()

            jFormattedTextFieldCNPJ.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.###.###/####-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jFormattedTextFieldCNPJ.setToolTipText("Cada instituição, seja ela pública ou privada, possui um CNPJ. Digite-o aqui.");
        jFormattedTextFieldCNPJ.addActionListener(new java.awt.event.ActionListener() {
            @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
               
            }
        });
View Full Code Here

Examples of javax.swing.JLabel.addActionListener()

        // TODO: do this properly for the fractional values case...
        int nColumns = integerValues ? Math.max(nCharsForValue((int) lowerBound), nCharsForValue((int) upperBound)) : 4;
        label.setColumns(nColumns);

        label.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (!ignoreChangeEvents) {
                        double newValue = Double.parseDouble(label.getText());
                        if (newValue >= lowerBound && newValue <= upperBound) {
                            changeValue(newValue);
View Full Code Here

Examples of javax.swing.JMenu.addActionListener()

      e = mimeTypes.keys();

      while(e.hasMoreElements()) {
    String major = (String)e.nextElement();
    JMenu imenu = new JMenu(major);
    imenu.addActionListener(this);
    minor = (String[]) mimeTypes.get(major);
    for(int i = 0 ; i < minor.length ; i++) {
        item = new JMenuItem(minor[i]);
        addMenuListener(item, major + "/" + minor[i]);
        imenu.add(item);
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.