GroupLayout.PREFERRED_SIZE) (jLabel5)) (18, 18, 18) (layout.createParallelGroup (javax.swing. GroupLayout. Alignment.BASELINE) (jButton1) (jButton2)) (javax.swing. GroupLayout.DEFAULT_SIZE, Short . MAX_VALUE))
);
();
} / /
void jButton1ActionPerformed (java.awt.event. ActionEvent evt) {
{id=Integer.parseInt (jTextField1.getText ()); name=jTextField2.getText (); tech=jTextField3.getText (); opis=jTextField4.getText (); n1=String. valueOf (jComboBox1.getSelectedItem ()); prov2=namepareTo («»); prov3=techpareTo («»); prov4=opispareTo («»); (prov2!=0 && prov3! =0 && prov4!=0)
{. forName («sun.jdbc.odbc. JdbcOdbcDriver»); connInfo=new Properties ();. put («user», «»);. put («password», «» );. put («charSet», «Cp1251»); conn=DriverManager.getConnection («jdbc: odbc: mydb», connInfo); s=conn.prepareStatement («UPDATE Маркі_авто SET Id_авто_характерістікі =?, Найменування =?, Тех_характерістікі =?, Опис =? n »+
«WHERE (((Найменування) =?));»);. setInt (1, id);. setString (2, name);. setString (3, tech);. setString ( 4, opis);. setString (5, n1);. executeUpdate ();. close ();. close ();. showMessageDialog (null, «Дані були відредаговані»);
} {JOptionPane.showMessageDialog (null, «Поля не повинні бути порожніми»);}
} (Exception ex)
{. out.println (ex);. showMessageDialog (null, «Не вдалося підключитися до бази даних»);
}
/ / TODO add your handling code here:
}
void jButton2ActionPerformed (java.awt.event. ActionEvent evt) {. setVisible (false);// TODO add your handling code here:
}
/ **
* @ param args the command line arguments
* / static void main (String args []) {
/ * Set the Nimbus look and feel * /
/ /
/ * If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see # «justify"> * / {(javax.swing.UIManager. LookAndFeelInfo info: javax.swing.UIManager.getInstalledLookAndFeels ()) {(«Nimbus». equals ( info.getName ())) {. swing.UIManager.setLookAndFeel (info.getClassName ());;
}
}
} catch (ClassNotFoundException ex) {. util.logging. Logger.getLogger (Table1Izm.class.getName ()). Log (java.util.logging. Level.SEVERE, null, ex);
} catch (InstantiationException ex) {. util.logging. Logger.getLogger (Table1Izm.class.getName ()). Log (java.util.logging. Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {. util.logging. Logger.getLogger (Table1Izm.class.getName ()). Log (java.util.logging. Level.SEVERE, null, ex);
} catch (javax.swing. UnsupportedLookAndFeelException ex) {. util.logging. Logger.getLogger (Table1Izm.class.getName ()). Log (java.util.logging. Level.SEVERE, null, ex);
}
/ /