private void populatePrinterList(String defaultitem) { DefaultComboBoxModel defComboBoxMod = new DefaultComboBoxModel(); LinkedList<String> tempPrinterList = JPrint.getPrinterNames(); for (int j = 0; j < tempPrinterList.size(); j++) { defComboBoxMod.addElement(tempPrinterList.get(j)); } int sel = defComboBoxMod.getIndexOf(defaultitem); ListModel jList1Model = defComboBoxMod; comboBoxPrintQueue.setModel((ComboBoxModel) jList1Model); comboBoxPrintQueue.setSelectedIndex(sel); if (JPrint.getNumberofPrinters() == 0) { comboBoxPrintQueue.setEnabled(false); } else { comboBoxPrintQueue.setEnabled(true); } }