Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to add in to ComboBox an ArrayList?

847432May 10 2011 — edited May 11 2011
Hello people,

So i come on this way to know how to implement an ArrayList into a ComboBox.

I would like to put in a ComoBox the audio mixers available from the computer in to a ComboBox, but i don´t know how to do that.

I made this method which show the mixers available:
public void showMixers(){
        
        mixInfo = new ArrayList<Mixer.Info>(Arrays.asList(AudioSystem.getMixerInfo()));
        
        String support;
        
        for(Mixer.Info mixInfos:mixInfo){
            
            Mixer mixer = AudioSystem.getMixer(mixInfos);
            
            support = ", supports";
            
            if(mixer.isLineSupported(portInfo))
                support += " Port ";
            if(mixer.isLineSupported(targetInfo))
                support += " TargetDataLine ";
            
            System.out.println("Mixer: "+ mixInfos.getName()+support+", "+mixInfos.getDescription());
            
        }
        
    }
I would like to put the values (which they are the mixers) into the combobox.

Any tips?
This post has been answered by TPD-Opitz on May 11 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2011
Added on May 10 2011
14 comments
1,694 views