Here you can find the source of newBox(String name, String... items)
public static JComboBox<String> newBox(String name, String... items)
//package com.java2s; import javax.swing.JComboBox; public class Main { public static JComboBox<String> newBox(String name, String... items) { JComboBox<String> box = new JComboBox<>(items); box.setName(name);//w ww . j ava 2 s .c o m return box; } }