Examples of DefaultListModel


Examples of javax.swing.DefaultListModel

    // The server calls this method as needed.
    public void addMessage (final String message) {
      EventQueue.invokeLater(new Runnable() {
        public void run () {
          DefaultListModel model = (DefaultListModel)messageList.getModel();
          model.addElement(message);
          messageList.ensureIndexIsVisible(model.size() - 1);
        }
      });
    }
View Full Code Here

Examples of javax.swing.DefaultListModel

            } catch (Exception ex) {
                setStatus(messageWriter.print1args("printFailed", ex.getMessage()));
                ex.printStackTrace();
            }
        } else if (e.getSource() == miChooseLanguage) {
            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

Examples of javax.swing.DefaultListModel

       
        // Now define the action list
        JPanel listPanel = new JPanel(new BorderLayout());
        listPanel.setBorder(BorderFactory.createTitledBorder(resources.getString("ActionList")));

        listModel = new DefaultListModel();
        for (Iterator it = actionList.iterator(); it.hasNext(); ) listModel.addElement(it.next());
        list = new JList(listModel);
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        listPanel.add(new JScrollPane(list), BorderLayout.CENTER);
        definitionBox.add(listPanel);
View Full Code Here

Examples of javax.swing.DefaultListModel

    protected DefaultListModel listModel;

    public LAFDialog(String title) {
      super(JSynoptic.gui.getOwner(),title,false); // Non modal => can play with L&F changes immediately
     
      listModel  = new DefaultListModel();

      //Create the list and put it in a scroll pane.
      list = new JList(listModel);
      list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      list.setVisibleRowCount(10);
View Full Code Here

Examples of javax.swing.DefaultListModel

   */
  public CheckBoxList(Object[] items, boolean[] checked) {
    super();
    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

Examples of javax.swing.DefaultListModel

   */
  public CheckBoxList(List items) {
        super();
        setCellRenderer(new CheckBoxListCellRenderer());
        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

Examples of javax.swing.DefaultListModel

     * @return Jlist containing the audiofiles.
     */
    protected JScrollPane getAudioList() {
        if (this.audioPane == null) {
            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

Examples of javax.swing.DefaultListModel

     *
     * @return
     */
    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

Examples of javax.swing.DefaultListModel

  public static JPanel createBitratePanel(final Statistic statistic) {
    JPanel result = new JPanel(new GridBagLayout());
    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"));
    final JCheckBox compressBox = new JCheckBox(LangageManager
        .getProperty("statistic.compressbitrates"));
    compressBox.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent arg0) {
        if (compressBox.isSelected()) {
          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);
          listModel.removeAllElements();
          for (int i = 0; i < recs.length; i++) {
            listModel.addElement(recs[i]);
          }
        }
        list.repaint();
      }
    });
View Full Code Here

Examples of javax.swing.DefaultListModel

    public void initialize() {
        cbLnf.setSelectedItem(appli.lookAndFeel);
        cbSmallIcon.setSelected(appli.getOptions().getIconSize().equals("16"));
        cbButtonType.setSelectedIndex(appli.getOptions().getButtonShow());
//        cbShowStatus.setSelected(appli.getOptions().getShowStatusBar());
        deletedIconList = new DefaultListModel();
        deletedIconList.addElement(GPToolBar.SEPARATOR_OBJECT);
        deletedButtonList = new DefaultListModel();
        deletedButtonList.addElement(GPToolBar.SEPARATOR_OBJECT);
        for (int i = 0; i < appli.getDeletedButtonList().size(); i++) {
            if (GPToolBar.SEPARATOR_OBJECT!=appli.getDeletedButtonList().getElementAt(i)) {
                deletedButtonList.addElement(appli.getDeletedButtonList()
                        .getElementAt(i));
            }
        }
        for (int i = 1; i < deletedButtonList.size(); i++) {
            if (((TestGanttRolloverButton) deletedButtonList.getElementAt(i))
                    .getIcon() == null)
                deletedIconList
                        .addElement(((TestGanttRolloverButton) deletedButtonList
                                .getElementAt(i)).getText());
            else
                deletedIconList
                        .addElement(((TestGanttRolloverButton) deletedButtonList
                                .getElementAt(i)).getIcon());
        }
        iconList = new DefaultListModel();
        buttonList = new DefaultListModel();
        for (int i = 0; i < appli.getButtonList().size(); i++)
            buttonList.addElement(appli.getButtonList().getElementAt(i));
        for (int i = 0; i < buttonList.size(); i++) {
            if (buttonList.elementAt(i).equals(
                    GPToolBar.SEPARATOR_OBJECT))
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.