Here you can find the source of getAgeComboBox()
public static JComboBox<Integer> getAgeComboBox()
//package com.java2s; //License from project: Apache License import java.util.Map; import java.util.TreeMap; import javax.swing.JComboBox; public class Main { public static Map<Integer, String> age = new TreeMap<>(); public static JComboBox<Integer> getAgeComboBox() { JComboBox<Integer> jcb = new JComboBox<Integer>(); for (int id : age.keySet()) { jcb.addItem(id);//from w w w . ja v a2 s . c o m } return jcb; } }