List of usage examples for java.awt List add
public void add(String item, int index)
From source file:op.care.info.DlgDiag.java
private void fillCMBs() { EntityManager em = OPDE.createEM();//from w ww . j av a2 s. c o m Query queryArzt = em.createQuery("SELECT a FROM GP a WHERE a.status >= 0 ORDER BY a.name, a.vorname"); java.util.List<GP> listAerzte = queryArzt.getResultList(); listAerzte.add(0, null); Query queryKH = em.createQuery("SELECT k FROM Hospital k WHERE k.state >= 0 ORDER BY k.name"); java.util.List<Hospital> listKH = queryKH.getResultList(); listKH.add(0, null); em.close(); cmbArzt.setModel(new DefaultComboBoxModel(listAerzte.toArray())); cmbArzt.setRenderer(GPTools.getRenderer()); cmbArzt.setSelectedIndex(0); cmbKH.setModel(new DefaultComboBoxModel(listKH.toArray())); cmbKH.setRenderer(HospitalTools.getKHRenderer()); cmbKH.setSelectedIndex(0); cmbSicherheit.setModel(new DefaultComboBoxModel(new String[] { SYSTools.xx("misc.msg.diag.security.na"), SYSTools.xx("misc.msg.diag.security.confirmed"), SYSTools.xx("misc.msg.diag.security.suspected"), SYSTools.xx("misc.msg.diag.security.rulingout"), SYSTools.xx("misc.msg.diag.security.conditionafter") })); cmbSicherheit.setSelectedIndex(1); cmbKoerper.setModel(new DefaultComboBoxModel( new String[] { SYSTools.xx("misc.msg.diag.side.na"), SYSTools.xx("misc.msg.diag.side.left"), SYSTools.xx("misc.msg.diag.side.right"), SYSTools.xx("misc.msg.diag.side.both") })); }