Question
help me to fill the TODO sections just write the code ... public void addStudentData () { /* TODO: get the values from the textfields
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 }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Java public void addStudentData TODO get the values from the textfields String studIdS studIdgetText...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started