void init() { contexts = cadsrModule.getAllContexts(); int contentCount = contextComboBox.getItemCount(); int i = 0; while (i <= contentCount && contentCount != 0) { contextComboBox.removeItemAt(i); contentCount = contextComboBox.getItemCount(); } for (Context _con : contexts) { contextComboBox.addItem(_con.getName()); } contextComboBox.setSelectedItem(PropertyAccessor.getProperty("gme.generate.default.context")); }