Java tutorial
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComboBox; public class Main { public static void main(String[] args) { JComboBox<String> emptyBox = new JComboBox<String>(); emptyBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Thread.dumpStack(); } }); emptyBox.addItem("test"); } }