try if equals jTextField5 getText String Name jTextField1 getText doub

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
try {
if (!"".equals(jTextField5.getText())){
String Name = jTextField1.getText();
double Price = Double.parseDouble(jTextField2.getText());
int n = Integer.parseInt(jTextField5.getText());
AppleList.set(n,new Apple(Name, Price));
}
} catch (Exception g) {
jLabel3.setText(g.toString());
}