top.show();
top.setVisible(true);
    public static void main(String[] argList) {        javax.swing.JFrame top = new javax.swing.JFrame("ListComboBoxTest");        final javax.swing.DefaultListModel dlm = new javax.swing.DefaultListModel();        final ListComboBoxModel lcbm = new ListComboBoxModel(dlm);        lcbm.addListDataListener(new ListDataListener() {            public void intervalRemoved(ListDataEvent evt) {                System.err.println("Interval Removed : " + evt);            }            public void intervalAdded(ListDataEvent evt) {                System.err.println("Interval Added : " + evt);            }            public void contentsChanged(ListDataEvent evt) {                System.err.println("ContentsChanged: " + evt);            }        });        dlm.addElement("a");        dlm.addElement("b");        dlm.addElement("c");        dlm.addElement("d");        javax.swing.JComboBox jcb = new javax.swing.JComboBox(lcbm);        jcb.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                System.err.println("Event : " + evt.paramString());            }        });        top.getContentPane().setLayout(new java.awt.BorderLayout());        top.addWindowListener(new java.awt.event.WindowAdapter() {            public void windowClosing(java.awt.event.WindowEvent evt) {                System.exit(0);            }        });        top.getContentPane().add(jcb, java.awt.BorderLayout.NORTH);        javax.swing.JButton clear = new javax.swing.JButton("CLEAR");        top.getContentPane().add(clear, java.awt.BorderLayout.SOUTH);        clear.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                dlm.clear();                System.err.println("DLM size = " + dlm.size());                System.err.println("Selected item = " + lcbm.getSelectedItem());            }        });        javax.swing.JButton select = new javax.swing.JButton("SELECT");        top.getContentPane().add(select, java.awt.BorderLayout.WEST);        select.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                lcbm.setSelectedItem(lcbm.getElementAt(0));                System.err.println("Selected " + lcbm.getSelectedItem());            }        });        // top.setBounds(100,100,600,400);        top.pack();        top.show();            }