|
Why does the A good answer might be:The paint() method of a Frame-object is used by the Java system when it wants to paint on the monitor screen. It is a mistake for you to call it directly. | |
Picture of myFrameThe picture for this program is much the same for the previous program. The class ezGUI2 holds a static main() method which is where the program starts running. Now the object in memory (referred to by the variable frm) is constructed using the class definition for myFrame. Here is a picture of what is going on:
When the system decides to paint on the monitor screen, it first does its work, then at the end calls the paint() method that is part of the myFrame object in main memory. The drawString() method in paint() puts some text on the monitor.
| |
QUESTION 12:Why not use System.out.println("Some Message") to put some text on the monitor? Click Here after you have answered the question |