Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am very inexperienced with java and therefore not very good at it. I am attemp

ID: 670271 • Letter: I

Question

I am very inexperienced with java and therefore not very good at it. I am attempting to write the code based on the following source code and I am struggling a great deal. Please help me.

/**
     * clear()
     *
     * Called when the Clear button is clicked. Clears all of the text fields by setting the contents to the empty string.
     * After clear() returns, no student information is being edited or displayed.
     *
     * PSEUDOCODE:
     * Set the mSearchText text field to ""
     * Set each of the homework text fields to ""
     * Set each of the exam text fields to ""
     * Set the mStudent reference to null
     */
    ??????

Explanation / Answer

We have to write click event for clear button..where inside that event method , we have to made explicityly text fields empty..and whatever you need. Here is the code

ClearButton.addSelectionListener(new SelectionAdapter() /*Clear button click event*/
{
@Override
public void widgetSelected(SelectionEvent e)
{
/*here we can make fields empty */
mSearchText.setText("");
homework.setText("");
exam.setText("");
this.mStudent = null; /*making reference null */
}
});

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote