main()
method?
It is a static
method of
the class TestFrame1
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.
If you change frame.setSize(150, 100)
to
frame.setSize(300, 100)
how will the frame appear?