Answer:
- How many objects are there? One
- Where is the
main()method? It is astaticmethod of the classTestFrame1
Picture of the Frame
The TestFrame1 class is defined
so that there is a place for the main()main()
When the main() method executes,
it asks the system to create a JFrame object (with new).
The variable frame refers to that object,
so the object's methods can be called.
The Java system keeps the frame active, even after the main() method
has ended.
The user can click on the frame, drag it on the monitor, resize it, and do all the
usual things.
QUESTION 6:
If you change frame.setSize(150, 100)
to
frame.setSize(300, 100)
how will the frame appear?