Which of the following represents the correct sequence of st
Which of the following represents the correct sequence of steps for how a JFrame is repainted?
repaint triggers a call to paintComponent, which tells all the components owned by the frame to paint themselves.
paint triggers a call to repaint, which tells all the components owned by the frame to call their paintComponent function
repaint triggers a call to the paintComponent function of all of the components owned by the frame. The last component tells the frame to call its paint function
repaint tells the frame to call its paint function, which, in turn, calls the paintComponent function of each of the components owned by the frame.
Solution
Answer:
repaint triggers a call to paintComponent, which tells all the components owned by the frame to paint themselves.
repaint() method will trigger a call to paintComponent method to tell that all compoennts which are owned by frame have to be refreshed.
