Exemple #1
0
 /** Creates new form JFAddDev */
 public JFAddDev() {
   initComponents();
   this.jLerr.setVisible(false);
   this.jLerr.setForeground(Color.red);
   DefaultComboBoxModel listSite = new DefaultComboBoxModel();
   listSite = DBMana.selectDBSite(listSite);
   selectSite.setModel(listSite);
   String siteName = (String) this.selectSite.getSelectedItem();
   DefaultComboBoxModel listRoom = new DefaultComboBoxModel();
   listRoom = DBMana.selectDBRoom(listRoom, siteName);
   selectRoom.setModel(listRoom);
   String os = (String) this.selectTypeDev.getSelectedItem();
   if ("Ordinateur".equals(os)) {
     DefaultComboBoxModel listOs = new DefaultComboBoxModel();
     listOs.addElement("OS x");
     listOs.addElement("Linux");
     listOs.addElement("Windows");
     selectOs.setModel(listOs);
   } else if ("Tablette".equals(os)) {
     DefaultComboBoxModel listOs = new DefaultComboBoxModel();
     listOs.addElement("iOS");
     listOs.addElement("Androïd");
     listOs.addElement("Windows");
     selectOs.setModel(listOs);
   }
 }
Exemple #2
0
 private void selectSiteActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_selectSiteActionPerformed
   // TODO add your handling code here:
   String siteName = (String) this.selectSite.getSelectedItem();
   DefaultComboBoxModel listRoom = new DefaultComboBoxModel();
   listRoom = DBMana.selectDBRoom(listRoom, siteName);
   selectRoom.setModel(listRoom);
 } // GEN-LAST:event_selectSiteActionPerformed