Package javax.swing

Examples of javax.swing.DefaultListModel.addElement()


            DefaultListModel listModel = new DefaultListModel();
            int nlang = resources.getIntValue("languageNumber");
            String oldcode = Run.getProperties().getString("jsynoptic.language", "");
            int sel = -1;
            for (int i = 0; i < nlang; ++i) {
                listModel.addElement(resources.getStringValue("languageName" + i));
                if (resources.getStringValue("languageCode" + i).equals(oldcode)) {
                    sel = i;
                }
            }
            JList langlist = new JList(listModel);
View Full Code Here


    setCellRenderer(new CheckBoxListCellRenderer());
    addListSelectionListener(this);
    DefaultListModel model = new DefaultListModel();
    isChecked = new boolean[checked.length];
    for (int i = 0; i < items.length; i++) {
      model.addElement(items[i]);
      isChecked[i] = checked[i];
    }
    this.setModel(model);
  }
View Full Code Here

        addListSelectionListener(this);
        DefaultListModel model = new DefaultListModel();
        isChecked = new boolean[items.size()];
       
        for(int i = 0; i < items.size(); i++) {
            model.addElement(items.get(i));
            isChecked[i] = false;
        }
        this.setModel(model);
    }
View Full Code Here

            this.audioPane = new JScrollPane();
            DefaultListModel audioModel = new DefaultListModel();
            Iterator it = this.audioFiles.iterator();
            while (it.hasNext()) {
                AudioFile current = (AudioFile) it.next();
                audioModel.addElement(current.getName() + " "
                        + getLength(current.getLength()));
            }
            JList list = new JList(audioModel);
            list.setEnabled(false);
            list.setCellRenderer(new AudioRenderer());
View Full Code Here

     */
    private JScrollPane getFreeDbList() {
        if (freeDbPane == null) {
            DefaultListModel freedbModel = new DefaultListModel();
            for (int i = 0; i < result.getTracksNumber(); i++)
                freedbModel.addElement(result.getTrackTitle(i));
            this.freedb = new JList(freedbModel);
            this.freedb.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            this.freedb.setCellRenderer(new FreedbRenderer());
            freeDbPane = new JScrollPane(freedb);
            freedb.getSelectionModel().addListSelectionListener(
View Full Code Here

    StringCountRecord[] records = statistic
        .getRecords(Statistic.MAP_BITRATE);
    Arrays.sort(records, NUMBER_SORTER);
    final DefaultListModel listModel = new DefaultListModel();
    for (int i = 0; i < records.length; i++) {
      listModel.addElement(records[i]);
    }
    final JList list = new JList(listModel);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JLabel desc = new JLabel(LangageManager
        .getProperty("statistic.categorydescription.bitrate"));
View Full Code Here

          StringCountRecord[] recs = statistic
              .getRecords(Statistic.MAP_BITRATE);
          String[] compressed = compressBitrates(recs);
          listModel.removeAllElements();
          for (int i = 0; i < compressed.length; i++) {
            listModel.addElement(compressed[i]);
          }
        } else {
          StringCountRecord[] recs = statistic
              .getRecords(Statistic.MAP_BITRATE);
          Arrays.sort(recs, NUMBER_SORTER);
View Full Code Here

    private ListModel getCategoryListModel() {
        DefaultListModel model = new DefaultListModel();
        for (ImporterWizardUI wizardUi : Lookup.getDefault().lookupAll(ImporterWizardUI.class)) {
            if (!model.contains(wizardUi.getCategory())) {
                model.addElement(wizardUi.getCategory());
            }
        }
        return model;
    }
View Full Code Here

        return wrapper;
    }

    private Component createTemplates() {
        DefaultListModel model = new DefaultListModel();
        model.addElement(createTemplate(0.0, 0.0, 1.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 0.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 1.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 1.0, 0.0));
        model.addElement(createTemplate(1.0, 0.0, 0.0, 1.0));
        model.addElement(createTemplate(1.0, 0.0, 1.0, 1.0));
View Full Code Here

    }

    private Component createTemplates() {
        DefaultListModel model = new DefaultListModel();
        model.addElement(createTemplate(0.0, 0.0, 1.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 0.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 1.0, 1.0));
        model.addElement(createTemplate(0.0, 1.0, 1.0, 0.0));
        model.addElement(createTemplate(1.0, 0.0, 0.0, 1.0));
        model.addElement(createTemplate(1.0, 0.0, 1.0, 1.0));
        model.addElement(createTemplate(1.0, 0.0, 1.0, 0.0));
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.