




























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































Windows
Create Window
We can move, resize, minimize, and maximize the Frame window. However, we can’t close the window because closing a window often implies ending the program. If the user needs to save a document or other settings before ending, your program needs a chance to do this. The closing involves handling the WindowEvent generated by a user attempting to close the window.
8
Clicking the X in the title bar of a JFrame causes the window to be hidden by default, but this does not cause your program to stop executing. We need to press Ctrl+c at the command prompt to stop the JVM, even though our JFrame is no longer visible on the screen.
Notice that the cancel Button is added to the Frame f. Whenever f is displayed, the cancel button is also displayed Notice that the Button consumes the entire interior of the Frame, no matter what size we make the Frame.