Create JComboBox using an array of String as the list of choices - Java Swing

Java examples for Swing:JComboBox

Description

Create JComboBox using an array of String as the list of choices

Demo Code

import javax.swing.JComboBox;

public class Main {

  public static void main(String[] args) {
    String[] sList = new String[] { "Spring", "Summer", "Fall", "Winter" };
    JComboBox<String> seasons = new JComboBox<>(sList);
  }//from w  ww.ja  v a2  s.co m
}

Related Tutorials