JFrame

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"

Setting the Frame's Mouse Cursor

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 ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.