rendered paste body private void addStaffProfile() throws NullInputException { StaffProfile tempStaffProfile = new StaffProfile(); tempStaffProfile.setExperience((StaffExperienceType)comboExperience.getSelectedItem()); if(txtLongQueueSize.getText().length() == 0){ throw new NullInputException(); } if(txtNormalServeSpeed.getText().length() == 0){ throw new NullInputException(); } if(txtImprovedServeSpeed.getText().length() == 0){ throw new NullInputException(); } try{ tempStaffProfile.setLongQueueSize(Integer.parseInt(txtLongQueueSize.getText())); tempStaffProfile.setNormalServeSpeed(Float.parseFloat(txtNormalServeSpeed.getText())); tempStaffProfile.setImprovedServeSpeed(Float.parseFloat(txtImprovedServeSpeed.getText())); } catch(NullInputException e){ JOptionPane.showMessageDialog(null, "Nothing has been entered", "look!",JOptionPane.ERROR_MESSAGE); } this.staffTableModel.addStaffProfile(tempStaffProfile); }