Package javax.swing

Examples of javax.swing.JComboBox.addItemListener()


  public final JComboBox getComboBoxSupplier(final int numberOf) {
    JComboBox tmp = new JComboBox(new ComboBoxAdapter(
        (ListModel) transportSupplierList, transportPresentationModel
            .getBufferedModel(TransportModel.PROPERTY_SUPPLIER)));

    tmp.addItemListener(new SupplierSelectionListener());
    tmp.setEnabled(hasWriteAccess());
    tmp.setName("ComboBoxSupplier" + numberOf);
    return tmp;
  }
View Full Code Here


   */
  public JComboBox getComboBoxSupplier(PresentationModel presentationModel) {
    JComboBox comboBox = new JComboBox(
        new ComboBoxAdapter(supplierList, presentationModel
            .getBufferedModel(ExternalOrderModel.PROPERTY_SUPPLIER)));
    comboBox.addItemListener(new SupplierSelectionListener(
        presentationModel));
    comboBox.setEnabled(hasWriteAccess());
    return comboBox;
  }

View Full Code Here

        column.setPreferredWidth(130);
      } else if (MetadataTableModel.IS_KEY_FIELD_INDEX == i) {// isKey
        column.setPreferredWidth(70);
      } else if (MetadataTableModel.CONSTRAINT_TYPE_INDEX == i) {// keyType
        JComboBox constraintTypeComboBox = new JComboBox(new ConstraintTypeComboBoxModel());
        constraintTypeComboBox.addItemListener(new ConstraintTypeComboBoxItemListener(this));
        column.setCellEditor(new DefaultCellEditor(constraintTypeComboBox));
        column.setPreferredWidth(250);
      } else if (MetadataTableModel.REFERENCING_TABLE_INDEX == i) {// ReferencingTable
        JComboBox referencingTableComboBox = new JComboBox();
        referencingTableComboBox.addPopupMenuListener(new TableComboBoxPopupMenuListener(this));
View Full Code Here

    try {
      loadHistory(combo);
    } catch (IOException e) {
      // fails the first time
    }
    combo.addItemListener(
      new ItemListener() {
        public void itemStateChanged(ItemEvent event) {
          if (event.getStateChange() == ItemEvent.SELECTED) {
            textChanged();
          }
View Full Code Here

        new ComboBoxAdapter(
            functionList,
            presentationModel
                .getBufferedModel(PreventiveActionModel.PROPERTY_JOB_FUNCTION)));
    comboBox.setName("ComboBoxFunction");
    comboBox.addItemListener(new FunctionItemListener(presentationModel));
    return comboBox;
  }

  /**
   * Lager komboboks for kategori
View Full Code Here

      new DefaultCellEditor(textField));
    table.getColumnModel().getColumn(1).setCellEditor(backgroundEditor);
    table.getColumnModel().getColumn(2).setCellEditor(foregroundEditor);

    background.addItemListener(new ColorItemListener(background));
    foreground.addItemListener(new ColorItemListener(foreground));

    table.getColumnModel().getColumn(0).setCellRenderer(
      new ExpressionTableCellRenderer());
    table.getColumnModel().getColumn(1).setCellRenderer(
      new ColorTableCellRenderer());
View Full Code Here

    swatches = new DefaultComboBoxModel();
    colorList = new SwatchPanel();
    colorList.addMouseListener(new SwatchPanelSelectionListener());

    final JComboBox comboBox = new JComboBox(swatches);
    comboBox.addItemListener(new SchemaSelectionListener());
    comboBox.setRenderer(new ColorChooserRenderer());

    final JPanel selectorPanel = new JPanel();
    selectorPanel.setLayout(new BorderLayout());
    selectorPanel.add(comboBox, BorderLayout.CENTER);
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

    String array[] = new String[] { "a", "b", "c" };

    JComboBox box = new JComboBox(array);

    box.addActionListener(this);
    box.addItemListener(this);

    box.setActionCommand(COMMAND);

    harness.check(box.getActionCommand(), COMMAND, "action command");
    harness.check(box.getItemCount(), 3, "item count");
View Full Code Here

{
  public void test(TestHarness harness)
  {
    JComboBox box = new JComboBox();
    box.addActionListener(this);
    box.addItemListener(this);
    checkListenerLists(harness, box);
  }

  private void checkListenerLists(TestHarness harness, JComboBox box)
  {
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.