Package javax.swing

Examples of javax.swing.DefaultComboBoxModel.removeAllElements()


         * {@inheritDoc}
         */
        public void run()
        {
          Object selected = filterAttribute.getSelectedItem();
          model.removeAllElements();
          model.addElement(USER_FILTER);
          model.addElement(GROUP_FILTER);
          model.addElement(COMBO_SEPARATOR);
          for (String newElement : newElements)
          {
View Full Code Here


            auxiliary.getAvailableListModel();
          SortableListModel<String> selectedListModel =
            auxiliary.getSelectedListModel();
          DefaultComboBoxModel structuralModel =
            (DefaultComboBoxModel)structural.getModel();
          structuralModel.removeAllElements();
          availableListModel.clear();
          selectedListModel.clear();
          for (String oc : structuralOcs)
          {
            structuralModel.addElement(oc);
View Full Code Here

    private void populateVoices() {
        Iterator<SpeechVoice> voices = speech.getAvailableVoices();

        // Populate the voices combo box.
        DefaultComboBoxModel oldModel = (DefaultComboBoxModel) voiceComboBox.getModel();
        oldModel.removeAllElements();
       
        // Put the "system default voice" option at the top.
        SpeechVoice defaultVoice = new SpeechVoice(DEFAULT_TTS_VOICE_NAME, SpeechLanguage.ENGLISH_US);
        oldModel.addElement(defaultVoice);       
       
View Full Code Here

        // Fill out the "engines" combo box.
        Iterator<TextToSpeechEngine> engines = speech.getAvailableEngines();
        TextToSpeechEngine currentEngine = speech.getTextToSpeechEngine();
        DefaultComboBoxModel oldModel = (DefaultComboBoxModel) enginesComboBox.getModel();
        oldModel.removeAllElements();
        int i = 0;
       
        while(engines.hasNext()) {
            TextToSpeechEngine next = engines.next();
           
View Full Code Here

        filteredFonts.add(s);
      }
    }
    DefaultComboBoxModel model = (DefaultComboBoxModel) fontSelector
        .getModel();
    model.removeAllElements();
    for (String s : filteredFonts) {
      model.addElement(s);
    }
  }
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.