June 2002
Beginner to intermediate
640 pages
14h 24m
English
Frames are top-level interfaces that pop up as windows and can be resized and closed. As containers, they typically contain panels and other components, for which they initiate layout management. They can also have an associated menubar and icons.
Here's an example of how a simple frame works using JFrame.
Import JFrame from javax.swing. Create an instance of it, show it, size it, change its title.
>>> from javax.swing import JFrame >>> frame = JFrame() >>> frame.show() >>> frame.size = 200,200
Set the title to "Hello JFC".
>>> frame.title = "Hello JFC"
With a frame, as with all components, you can set the mouse cursor. You'll probably want to make the cursor wait during a long operation so it shows ...
Read now
Unlock full access