JavaFXが標準SDKにはいってないとかどーとかなので気にせずSwing使っていきます
import java.util.List; import java.util.ArrayList; import java.util.stream.Stream; import javax.sound.sampled.Mixer; import javax.sound.sampled.AudioSystem; import javax.swing.JFrame; import javax.swing.JList; import javax.swing.SwingUtilities; import javax.swing.border.LineBorder; import java.awt.Color; import java.awt.Dimension; public class AudioSample extends JList<Mixer.Info>{ public static void main(String... args){ SwingUtilities.invokeLater(() ->{ var frame = new JFrame(); var sample = new AudioSample(AudioSample.getLineInput().toArray(new Mixer.Info[0])); sample.setPreferredSize(new Dimension(400, 300)); sample.setBorder(new LineBorder(Color.BLACK)); frame.add(sample); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.pack(); }); } public AudioSample(Mixer.Info[] elements){ super(elements); } public static List<Mixer.Info> getLineInput(){ return Stream.of(AudioSystem.getMixerInfo()) .filter(info -> info.getName().startsWith("Port ライン入力")) .collect(ArrayList::new, List::add, List::addAll); } }