Package javax.swing

Examples of javax.swing.JComboBox.addItem()


        JComboBox types = new JComboBox();

        connTypes = ConnectionDialogCommon.getTypes();

        for (int i = 0; i < connTypes.length; i++) {
            types.addItem(connTypes[i][0]);
        }

        types.addItemListener(this);
        controls.add(types);
        controls.add(Box.createVerticalGlue());
View Full Code Here


    private JComboBox phaseComboBox(List phases, String selectedChild) {
        JComboBox result = new JComboBox();
       
        for (Iterator i = phases.iterator(); i.hasNext();) {
            String phase = (String) i.next();
            result.addItem(phase);
            if (phase.equals(selectedChild))
                result.setSelectedItem(phase);
        }
       
        return result;
View Full Code Here

                    int counter = 0;
                    while (tokenizer.hasMoreTokens())
                    {
                        String token = tokenizer.nextToken();
                        listItem = new TextValuePair(token, token);
                        field.addItem(listItem);
                        if (set.equals(token))
                        {
                            field.setSelectedIndex(field.getItemCount() - 1);
                        }
                        counter++;
View Full Code Here

                }
                else
                {
                    listItem = new TextValuePair(getText((XMLElement) choices.elementAt(i)),
                            ((XMLElement) choices.elementAt(i)).getAttribute(COMBO_VALUE));
                    field.addItem(listItem);

        XMLElement choiceElement = (XMLElement) choices.elementAt(i);

        variables.add(spec.getAttribute(VARIABLE));
        values.add("combo");
View Full Code Here

                if (!OsConstraint.oneMatchesCurrentSystem(choice_el)) continue;

                String value = choice_el.getAttribute(SEARCH_VALUE);

                combobox.addItem(value);

                String set = ((XMLElement) choices.elementAt(i)).getAttribute(SET);
                if (set != null)
                {
                    if (set != null && !"".equals(set)){
View Full Code Here

            if (!TextUtils.isEmpty(filter))
            {
               if (!filters.contains(filter))
               {
                  comboBox.addItem(filter);
                  updateFilterConfig();
               }
            }
         }
      });
View Full Code Here

  private void setColumnEditor(JTable tbl, int col, NodeList nodes) {
    JComboBox box = new JComboBox();
    box.setFont(getFont());
    box.setEditable(false);
    box.addItem("");
    box.addFocusListener(this);
    for (int i = 0; i < nodes.getLength(); i++)
      box.addItem(((Element) nodes.item(i)).getAttribute("Name"));
    tbl.getColumnModel().getColumn(col).setCellEditor(
        new DefaultCellEditor(box));
View Full Code Here

    box.setFont(getFont());
    box.setEditable(false);
    box.addItem("");
    box.addFocusListener(this);
    for (int i = 0; i < nodes.getLength(); i++)
      box.addItem(((Element) nodes.item(i)).getAttribute("Name"));
    tbl.getColumnModel().getColumn(col).setCellEditor(
        new DefaultCellEditor(box));
  }

  public Rectangle getPreferredBounds() {
View Full Code Here

    panel.setBorder(new EtchedBorder());
    panel.setLayout(new BorderLayout());
    panel.add(new JLabel("ExecutionType:"), BorderLayout.WEST);
    JComboBox comboBox = new JComboBox();
    if (graph.hasChildren()) {
      comboBox.addItem("parallel");
      comboBox.addItem("sequential");
    } else if (graph.getModel().getExecutionType().equals("task")) {
      comboBox.addItem("parallel");
      comboBox.addItem("sequential");
      comboBox.addItem("task");
View Full Code Here

    panel.setLayout(new BorderLayout());
    panel.add(new JLabel("ExecutionType:"), BorderLayout.WEST);
    JComboBox comboBox = new JComboBox();
    if (graph.hasChildren()) {
      comboBox.addItem("parallel");
      comboBox.addItem("sequential");
    } else if (graph.getModel().getExecutionType().equals("task")) {
      comboBox.addItem("parallel");
      comboBox.addItem("sequential");
      comboBox.addItem("task");
    } else if (graph.isCondition()
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.