Java tutorial
import javax.swing.JComboBox; import javax.swing.JFrame; public class Main { public static void main(String[] args) { JComboBox<String> my = new JComboBox<>(new String[] { "HELLO WORLD", "java2s.com" }); JFrame frame = new JFrame(""); frame.add(my); frame.pack(); frame.setVisible(true); my.setSelectedIndex(1); } }