Package javax.swing

Examples of javax.swing.JComboBox.addItemListener()


                    sessionParameterTextArea.setCaretPosition(0);
                }
            }
        });

        configs.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                FileEntry fe = (FileEntry) e.getItem();

                sessionParameterTextArea.setText(ClientHelper.readFileAndRemoveHeader(fe.getFile()));
                sessionParameterTextArea.setCaretPosition(0);
View Full Code Here


        combobox.setSelectedItem(defaultChoice);
        _addPair(name, lbl, combobox, combobox);

        // Add the listener last so that there is no notification
        // of the first value.
        combobox.addItemListener(new QueryItemListener(name));
    }

    /** Create a ColorChooser.
     *  @param name The name used to identify the entry (when calling get).
     *  @param label The label to attach to the entry.
View Full Code Here

            List<String> unusedValues = getUnusedValues();

            for (String s : unusedValues) {
                combo.addItem(s);
            }
            combo.addItemListener(new ItemListener() {

                @Override
                public void itemStateChanged(ItemEvent e) {
                    fireEditionStateChanged(true);
                    refreshUsedValuesListAndCombos(combo);
View Full Code Here

    combo.setName(property);
    label.setLabelFor(combo);
    combo.setSelectedItem(values.get(Defaults.get(property)));
    // Sets maximum size to minimal one, otherwise springLayout will stretch this
    combo.setMaximumSize(new Dimension(combo.getMaximumSize().width, combo.getMinimumSize().height));
    combo.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        // As Map does not allows reverse mapping, scans the entire keyset to
        // find the key corresponding to a given object
        Object[] keys = values.keySet().toArray();
        for (Object key : keys) {
View Full Code Here

    combo.setName(property);
    label.setLabelFor(combo);
    combo.setSelectedItem(Defaults.get(property));
    // Sets maximum size to minimal one, otherwise springLayout will stretch this
    combo.setMaximumSize(new Dimension(combo.getMaximumSize().width, combo.getMinimumSize().height));
    combo.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        Defaults.set(property, (String) e.getItem());
      }
    });
    cont.add(label);
View Full Code Here

        System.out.println("Item: " + itemEvent.getItem());
        ItemSelectable is = itemEvent.getItemSelectable();
        System.out.println(", Selected: " + selectedString(is));
      }
    };
    comboBox.addItemListener(itemListener);

    frame.setSize(400, 200);
    frame.setVisible(true);
  }
}
View Full Code Here

    JComboBox comboBox = Util
        .getComboBoxJobFunction(
            true,
            presentationModel
                .getBufferedModel(DeviationModel.PROPERTY_DEVIATION_FUNCTION));
    comboBox.addItemListener(new DeviationFunctionItemListener(
        presentationModel));
    comboBox.setEnabled(hasWriteAccess());
    comboBox.setName("ComboBoxDeviationFunction");
    return comboBox;
  }
View Full Code Here

    JComboBox comboBox = new JComboBox(
        new ComboBoxAdapter(
            (ListModel) functionCategoryList,
            presentationModel
                .getBufferedModel(DeviationModel.PROPERTY_FUNCTION_CATEGORY)));
    comboBox.addItemListener(new DeviationCategoryItemListener(
        presentationModel));
    comboBox.setEnabled(hasWriteAccess());
    comboBox.setName("ComboBoxFunctionCategory");
    return comboBox;
  }
View Full Code Here

                    sessionParameterTextArea.setCaretPosition(0);
                }
            }
        });

        configs.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                FileEntry fe = (FileEntry) e.getItem();

                sessionParameterTextArea.setText(ClientHelper.readFileAndRemoveHeader(fe.getFile()));
                sessionParameterTextArea.setCaretPosition(0);
View Full Code Here

     *
     */
    public static JComboBox createUndoableComboBox() {
        JComboBox comboBox = new JComboBox();
        initFormWidget(comboBox);
        comboBox.addItemListener(new JComboBoxUndoListener());
        comboBox.setBackground(Color.WHITE);
        comboBox.setMaximumRowCount(ModelerPreferences.COMBOBOX_MAX_VISIBLE_SIZE);
        return comboBox;
    }

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.