import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.Timer;
public class Main {
public static void main(String[] args) {
int TIMER_DELAY = 2000;
String[] data = { "A", "B", "C", "D" };
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>(data);
JComboBox<String> combobox = new JComboBox<>(model);
JList<String> jlist = new JList<>(model);
new Timer(TIMER_DELAY, new ActionListener() {
private int count = 0;
public void actionPerformed(ActionEvent e) {
model.addElement("count: " + count);
count++;
}
}).start();
JPanel comboPanel = new JPanel();
comboPanel.add(combobox);