help me to fill the TODO sections just write the code ... public void addStudentData () {
Question:
help me to fill the TODO sections just write the code ...
public void addStudentData() { /* TODO: get the values from the textfields */ String studIdS = studId.getText().trim(); String yearStudyS = yearStudy.getText().trim(); /* TODO: validate whether the studIdS and yearStudyS are occupied, BOTH have to be occupied for the add to take place, if one or both are unoccupied print the following message in the validateStudent label -> message to be printed is "Error: cannot add student if studId or year of study not filled in" If both are occupied then go ahead with the addStudentData() */ //do the if...here if (studIdS != studId.getText()){ } //do the else...here, first ensure that the validateStudent label is clear of any text else { Label validateStudent = this.validateStudent; validateStudent.setText("Error: cannot add student if studId or year of study not filled in"); } studentToAdd = null; //use the getInstance() to addStudentData() //select the student that has been added so that it is highlighted on the list }
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates