Package javax.swing

Examples of javax.swing.JComboBox.addActionListener()


        Object[] ids = DateTimeZone.getAvailableIDs().toArray();
        final JComboBox zoneSelector = new JComboBox(ids);
        zoneSelector.setSelectedItem(DateTimeZone.getDefault().getID());
        panel.add(fixedSize(zoneSelector));

        zoneSelector.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                String id = (String)zoneSelector.getSelectedItem();
                iChronology = ISOChronology.getInstance(DateTimeZone.forID(id));
                updateResults();
            }
View Full Code Here


      final JComboBox dashComboBox = new JComboBox(new Object[]{BorderStyle.SOLID, BorderStyle.DASHED,
          BorderStyle.DOTTED, BorderStyle.DOT_DASH, BorderStyle.DOT_DOT_DASH});
      dashComboBox.setRenderer(new BorderStyleRenderer());
      dashComboBox.setSelectedItem(borderStyle);
      dashComboBox.addActionListener(new DashSelectionHandler(dashComboBox));
      this.add(dashComboBox, constraints);

      // Add the sample box
      constraints.gridx = 0;
      constraints.gridy = 2;
View Full Code Here

   
    if (comboValues != null) {
        lc = new LabelledComponent(propLabel + ":",
                      new JComboBox(comboValues));
        JComboBox comp = (JComboBox)lc.getComponent();
         comp.addActionListener(this);

        lc.setClientData(propName);
    }

    extraItems = new LabelledComponent[0];
View Full Code Here

    else {
      distinctCoBo.setSelectedIndex(2);
    }

    // define listener for distinct ComboBox...
    distinctCoBo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        int chosen = distinctCoBo.getSelectedIndex(); // get new
        // state

        // set distinctState in selectOP...
View Full Code Here

    final JComboBox orderByCoBo = new JComboBox(new String[] { "ASC", "DESC" });
    orderByCoBo.setFont(this.parent.getFONT());
    orderByCoBo.setSelectedIndex(selectedIndex);
    orderByCoBo.setEnabled(active);
    orderByCoBo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        int chosen = orderByCoBo.getSelectedIndex(); // get new
        // state

        // update sortContainer of current element...
View Full Code Here

        c.weightx = 1.0;
        final JComboBox fileFilterCombo = new JComboBox(createFilterComboBoxModel());
       
        filesOfTypeLabel.setLabelFor(fileFilterCombo);
       
        fileFilterCombo.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                fileNameField.setText("");
                getFileChooser().setFileFilter((FileFilter)fileFilterCombo.getSelectedItem());
            }
        });
View Full Code Here

      clearButton.setToolTipText("Clear any applied filter");
      deleteButton.setToolTipText("Delete this filter from saved filters");
      saveButton.setToolTipText("Add this filter to saved filters");

      comboBox.addActionListener(new ActionListener()
      {
         public void actionPerformed(ActionEvent e)
         {
            doFilter((String) comboBox.getSelectedItem());
         }
View Full Code Here

        c.weightx = 1.0;
        final JComboBox fileFilterCombo = new JComboBox(createFilterComboBoxModel());
       
        filesOfTypeLabel.setLabelFor(fileFilterCombo);
       
        fileFilterCombo.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                fileNameField.setText("");
                getFileChooser().setFileFilter((FileFilter)fileFilterCombo.getSelectedItem());
            }
        });
View Full Code Here

        c.weightx = 1.0;
        final JComboBox fileFilterCombo = new JComboBox(createFilterComboBoxModel());
       
        filesOfTypeLabel.setLabelFor(fileFilterCombo);
       
        fileFilterCombo.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
                fileNameField.setText("");
                getFileChooser().setFileFilter((FileFilter)fileFilterCombo.getSelectedItem());
            }
        });
View Full Code Here

      filterText.addKeyListener(
        new ExpressionRuleContext(filterModel, filterText));
      filterText.getDocument().addDocumentListener(
        new DelayedFilterTextDocumentListener(filterText));
      filterCombo.setEditable(true);
      filterCombo.addActionListener(
        new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
            if (e.getActionCommand().equals("comboBoxEdited")) {
              try {
                //verify the expression is valid
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.