Adding a Main Window: First Cut

We're going to create the main window for the address book application, which will have the list on the left side of the frame—when the user selects an item, it appears in the AddressForm instance on the right side. To do this we'll convert AddressForm so that it extends java.awt.Panel instead of java.awt.Frame. We'll also need to add some code to initialize the text fields in the AddressForm class (in AddressForm.py) so that every time an address is passed to AddressForm (that is, when the user selects a name in the list), AddressForm shows that Address instance.

Here is a listing of AddressForm in AddressFormPane.py:

 from Address7 import Address ... # AddressForm Class. # This class is used to edit an instance ...

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.