private void setConfigDefaults() { try { Properties config = Util.getConfig(null); for (Comboitem item : portBaudRate.getItems()) { if (config.getProperty(Constants.SERIAL_PORT_BAUD).equals(item.getValue())) { portBaudRate.setSelectedItem(item); } } portsToScan.setValue(config.getProperty(Constants.SERIAL_PORTS)); cfgWindOffset.setValue(config.getProperty(Constants.WIND_ZERO_OFFSET)); String useChoice = config.getProperty(Constants.DNS_USE_CHOICE); if (Constants.DNS_USE_BOAT.equals(useChoice)) { useHomeGroup.setSelectedItem(useBoatRadio); } else { useHomeGroup.setSelectedItem(useHomeRadio); } if (new Boolean(config.getProperty(Constants.PREFER_RMC))) { useRmcGroup.setSelectedItem(useRmcRadio); } else { useRmcGroup.setSelectedItem(useHdgRadio); } } catch (Exception e) { logger.error(e.getMessage(), e); Messagebox.show("There has been a problem with loading the configuration:" + e.getMessage()); } }
private void loadSemester() throws Exception { cmbSemester.getItems().clear(); Comboitem item1 = new Comboitem(); item1.setValue(1); item1.setLabel("Gasal (1)"); cmbSemester.appendChild(item1); Comboitem item2 = new Comboitem(); item2.setValue(2); item2.setLabel("Genap (2)"); cmbSemester.appendChild(item2); }
private void loadTahun() throws Exception { int currentYear = new DateTime().getYear(); cmbTahun.getItems().clear(); Comboitem item = new Comboitem(); item.setValue(""); item.setLabel("-- Pilih Tahun --"); cmbTahun.appendChild(item); for (int x = 2000; x <= currentYear; x++) { Comboitem itm = new Comboitem(); itm.setValue(x); itm.setLabel(x + ""); cmbTahun.appendChild(itm); } }
private void loadProgdi() throws Exception { try { ProgramStudiDAO dao = new ProgramStudiDAOImpl(); List<ProgramStudi> progdis = dao.getProgramStudi(); cmbProgdi.getItems().clear(); for (ProgramStudi ps : progdis) { Comboitem items = new Comboitem(); items.setValue(ps); items.setLabel(ps.getKode() + " " + ps.getNama()); cmbProgdi.appendChild(items); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } }
public void loadDosenOnChanging(String nama) throws Exception { try { DosenDAO dao = new DosenDAOImpl(); List<Dosen> dosens = dao.getsByName(nama, (ProgramStudi) cmbProgdi.getSelectedItem().getValue()); cmbNamaDosen.getItems().clear(); for (Dosen d : dosens) { Comboitem items = new Comboitem(); items.setValue(d); items.setLabel(d.getNama()); cmbNamaDosen.appendChild(items); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } }
public void onSelect$compagne() throws SQLException { poste_travail.getItems().clear(); poste_travail.setVisible(true); String compagne_id = (String) map_compagne.get((String) compagne.getSelectedItem().getLabel()); StatCotationEmployeModel cotationMoel = new StatCotationEmployeModel(); map_poste = cotationMoel.getListPostTravailValid(compagne_id); Set set = (map_poste).entrySet(); Iterator i = set.iterator(); while (i.hasNext()) { Map.Entry me = (Map.Entry) i.next(); poste_travail.appendItem((String) me.getKey()); } poste_travail.setSelectedIndex(0); }
public void loadDosen() throws Exception { try { cmbNamaDosen.setValue(""); DosenDAO dao = new DosenDAOImpl(); List<Dosen> dosens = dao.getsByProdi((ProgramStudi) cmbProgdi.getSelectedItem().getValue()); cmbNamaDosen.getItems().clear(); for (Dosen d : dosens) { Comboitem items = new Comboitem(); items.setValue(d); items.setLabel(d.getNama()); cmbNamaDosen.appendChild(items); } } catch (Exception ex) { ex.printStackTrace(); Messagebox.show(ex.getMessage()); } }
private void loadKecamatan() throws Exception { Connection conn = getConn(); try { KecamatanDAO dao = new KecamatanDAOImpl(conn); cmbKecamatan.getItems().clear(); for (Kecamatan kec : dao.gets()) { Comboitem item = new Comboitem(); item.setValue(kec); item.setLabel(kec.getNama()); cmbKecamatan.appendChild(item); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } finally { conn.close(); } }
private void loadJenjangStudi() throws Exception { try { JenjangStudiDAO dao = new JenjangStudiDAOImpl(); List<JenjangStudi> jenjangStudi = dao.getUnfinised(); cmbJenjangStudi.getItems().clear(); Comboitem item = new Comboitem(); item.setValue(null); item.setLabel("Semua"); cmbJenjangStudi.appendChild(item); for (JenjangStudi o : jenjangStudi) { Comboitem items = new Comboitem(); items.setValue(o); items.setLabel(o.getNama()); cmbJenjangStudi.appendChild(items); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } }
private void loadProgdi() throws Exception { try { UKProgramStudiDAO dao = new UKProgramStudiDAOImpl(); List<UKProgramStudi> progdis = dao.gets(); cmbProgdi.getItems().clear(); Comboitem item = new Comboitem(); item.setValue(null); item.setLabel("--Pilih Prodi--"); cmbProgdi.appendChild(item); for (UKProgramStudi ps : progdis) { Comboitem items = new Comboitem(); items.setValue(ps); items.setLabel(ps.getShortKode() + " " + ps.getNama()); cmbProgdi.appendChild(items); } } catch (Exception ex) { Messagebox.show(ex.getMessage()); } }