public GestRestaurant(int id_restaurant) { initComponents(); RestaurantDAO res = new RestaurantDAO(); Restaurant r = new Restaurant(); r = res.findRestaurantById(id_restaurant); SessionRestoTunisie.crtResto = r; jId.setText(String.valueOf(r.getId())); jNom.setText(r.getNom()); jAdresse.setText(r.getAdresse()); jDesc.setText(r.getDescription()); jTelephone.setText(String.valueOf(r.getNumTel())); jUrl.setText(String.valueOf(r.getUrl())); jAdressePanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jAdressePanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); jAdressePanel1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); jAdressePanel1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); jAdresse.setWrapStyleWord(true); jAdresse.setLineWrap(true); jDesc.setWrapStyleWord(true); jDesc.setLineWrap(true); setLocationRelativeTo(null); title.setHorizontalAlignment(JLabel.CENTER); try { title.setFont(new FontsPartieRestaurateur().getFont(FontsPartieRestaurateur.TITLE, 50)); } catch (FontFormatException ex) { Logger.getLogger(ConsultRestaurant.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(ConsultRestaurant.class.getName()).log(Level.SEVERE, null, ex); } title.setText("Gestion du restaurant # " + r.getId()); jType.setSelectedIndex(0); this.id_restaurant = id_restaurant; }
private void btnEffectuerMouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_btnEffectuerMouseClicked // TODO add your handling code here: Restaurant r = new Restaurant(); r.setId(Integer.parseInt(jId.getText())); r.setNom(jNom.getText()); r.setAdresse(jAdresse.getText()); r.setNumTel(Integer.parseInt(jTelephone.getText())); r.setDescription(jDesc.getText()); r.setUrl(jDesc.getText()); r.setType(jType.getSelectedItem().toString()); res.updateRestaurantInterGestRes(r); setEnabled(false); FlatosDialogos fd = new FlatosDialogos(this, "Modifié !", 50f, true); fd.setVisible(true); } // GEN-LAST:event_btnEffectuerMouseClicked