import javax.swing.DefaultListModel;
import javax.swing.JList;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
// Create a list that allows adds and removes
DefaultListModel model = new DefaultListModel();
JList list = new JList(model);
int pos = list.getModel().getSize();
model.add(pos, "E");
}
}