Reputation: 55
In my private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) I have error message:
My first field (IdentCat) is normaly an Int. However I don't know how to do this in INT ?
ap.setIdentCat(jTextIdent.getText().toUpperCase());
More of code
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Categorie ap = new Categorie();
ap.setIdentCat(jTextIdent.getText().toUpperCase());
ap.setDenomCat(jTextDescr.getText());
boolean ok = daoCat.insertCategorie(ap);
if (!ok)
JOptionPane.showMessageDialog(null,"Insertion impossible !","Avertissement",JOptionPane.ERROR_MESSAGE);
this.dispose();
}
Upvotes: 0
Views: 102
Reputation: 8178
Use Integer.valueOf("string")
as alternative too! This will return an Integer object.
String number = "10";
Integer result = Integer.valueOf(number);
Upvotes: 3