import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JComboBox;
import javax.swing.JFrame;
public class Main {
public Main() {
Map map = createMap();
JComboBox cbox = createComboBox(map);
JFrame frame = new JFrame();
frame.add(cbox);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
private Map createMap() {
Map map = new HashMap<>();
Student s1 = new Student(23, "M");
Student s2 = new Student(6, "L");
Student s3 = new Student(3, "C");
Student s4 = new Student(8, "K");
Student s5 = new Student(21, "T");
map.put(s1.getId(), s1);