What would happen if the call to super.paintComponent were removed from the paintComponent method of the CoordinatesPanel class? Remove it and run the program to test your answer.
What will be an ideal response?
The paintComponent method is a member of class CoordinatesPanel which extends JPanel which means that the call to super.paintComponent is a call to the paintComponent method of the JPanel class. Without this call, the paintComponent method of the JPanel class is not called. As a consequence, the background is not cleared each time. This means that the previously drawn dots would be visible, the background color would not be drawn, and the count value would overwrite itself until it became unreadable.
You might also like to view...
What is the value assigned to the variable in each of these cases? Explain curious results. Be careful! int x, y;
a) x = 1/2; b) y = 3.0/2.0; double z, w, t; c) z = 1/2; d) w = 3/2; e) t = 3.0/2.0;
Member function definitions:
a. Always require the binary scope operator (::). b. Require the binary scope operator only when being defined outside of the definition of their class. c. Can use the binary scope operator anywhere, but become public functions. d. Must use the binary scope operator in their function prototype.
Object-oriented programming allows you to derive new classes from existing classes. This is called ____________.
a. encapsulation b. inheritance c. abstraction d. generalization
Which of the following What-If analysis tools is an add-in?
A) Goal Seek B) PivotTable C) Solver D) Scenario Manager