@SuppressWarnings("unchecked")
        private void update() {
            if (filter == null || filter.length() == 0) {
                super.setModel(originalModel);
            }

            DefaultListModel v = new DefaultListModel();
            for (int i = 0; i < originalModel.getSize(); i++) {
                Object o = originalModel.getElementAt(i);
                String s = String.valueOf(o).toLowerCase();
                if (s.contains(filter)) {
                    v.addElement(o);
                }
            }
            super.setModel(v);
            if (v.getSize() == 1) {
                setSelectedIndex(0);
            }
            revalidate();
        }
Code to create components and action listeners.

@param classes
           what Classes to show in the list box
jme3-examples/src/main/java/jme3test/TestChooser.java