Package javax.swing

Examples of javax.swing.JComboBox.addItem()


    private static void setUpColorColumn(TableColumn column) {
      JComboBox comboBox = new JComboBox();
      comboBox.setEditable(true);
      comboBox.addItem("Blue");
      comboBox.addItem("Red");
      comboBox.addItem("Yellow");
      column.setCellEditor(new DefaultCellEditor(comboBox));
    }
  }
}
View Full Code Here


    private static void setUpColorColumn(TableColumn column) {
      JComboBox comboBox = new JComboBox();
      comboBox.setEditable(true);
      comboBox.addItem("Blue");
      comboBox.addItem("Red");
      comboBox.addItem("Yellow");
      column.setCellEditor(new DefaultCellEditor(comboBox));
    }
  }
}
View Full Code Here

                return;
              }

              //should be 'valid expression' check
              if (!(v.contains(filterCombo.getSelectedItem()))) {
                filterCombo.addItem(filterCombo.getSelectedItem());
              }
            }
          }
        });
      upperPanel.add(filterCombo, BorderLayout.CENTER);
View Full Code Here

        JComboBox combo = new JComboBox();
        Collection<List<Ambulance>> ambulances = CityEntities.ambulances.values();
        for (List<Ambulance> listOfAmbulances : ambulances) {
            for (Ambulance ambulance : listOfAmbulances) {
                String item = "Ambulance - " + ambulance.getId();
                combo.addItem(item);
            }
        }
       
    }
View Full Code Here

  {
    JComboBox box = selectors[i];
    box.removeAllItems();
    for (int j=0;j<orderings.length;j++)
    {
      box.addItem(orderings[j]);
    }
    box.setVisible(true);
  }
}
View Full Code Here

        public void actionPerformed(ActionEvent e) {
            TravelingSalesmanTour travelingSalesmanTour = tspPanel.getTravelingSalesmanTour();
            JComboBox previousAppearanceListField = new JComboBox();
            for (Appearance previousAppearance : travelingSalesmanTour.getVisitList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            for (Appearance previousAppearance : travelingSalesmanTour.getDomicileList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            previousAppearanceListField.setSelectedItem(visit.getPreviousAppearance());
View Full Code Here

            JComboBox previousAppearanceListField = new JComboBox();
            for (Appearance previousAppearance : travelingSalesmanTour.getVisitList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            for (Appearance previousAppearance : travelingSalesmanTour.getDomicileList()) {
                previousAppearanceListField.addItem(previousAppearance);
            }
            previousAppearanceListField.setSelectedItem(visit.getPreviousAppearance());
            int result = JOptionPane.showConfirmDialog(TspListPanel.this.getRootPane(), previousAppearanceListField,
                    "Visit " + visit.getCity().getSafeName() + " after", JOptionPane.OK_CANCEL_OPTION);
            if (result == JOptionPane.OK_OPTION) {
View Full Code Here

        sessionConfigurations = ClientHelper.readFileProperties(CONFIGS_FOLDER + CONFIGS_LIBRARY, CONFIGS_FOLDER);

        final JComboBox configs = new JComboBox();
        configs.setMaximumRowCount(20);

        configs.addItem(new FileEntry("", null));
        if (sessionConfigurations != null) {
            for (FileEntry fe : sessionConfigurations) {
                configs.addItem(fe);
            }
        }
View Full Code Here

        configs.setMaximumRowCount(20);

        configs.addItem(new FileEntry("", null));
        if (sessionConfigurations != null) {
            for (FileEntry fe : sessionConfigurations) {
                configs.addItem(fe);
            }
        }
        expertPanel.add(configs, BorderLayout.PAGE_START);

        sessionParameterTextArea = new JTextArea();
View Full Code Here

    JFrame frame = new JFrame();
    frame.setSize(200, 100);
    Container contentPane = frame.getContentPane();
   
    JComboBox box = new JComboBox();
    box.addItem("123");
    box.addItem("aaa");
    box.addItem("abc");
   
    contentPane.add(box, BorderLayout.SOUTH);
    frame.show();
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.