My code:
name = jTextFieldName.getText();
admin = Integer.parseInt(jTextFieldAdmin.getText());
anal = Integer.parseInt(jTextFieldAnalytical.getText());
creat = Integer.parseInt(jTextFieldCreative.getText());
finish = Integer.parseInt(jTextFieldFinisher.getText());
persons.addPerson(name, admin, anal, creat, finish);
persons.savePersons();
I want to make sure that name is a string and that admin, anal, creat and finish are ints between 0 and 30. I'm thinking that I should use try-catch, but I don't know exactly how to use it in this context. Any help appreciated!