Adding a Main Window for the Address Book Application: Prototype

The main window will have a list of names from the address book. As you select a name from the list, an AddressForm instance pops up in which you edit the Address instance corresponding to that name.

As a rule, code written to access data shouldn't be in the same module with code written to build GUIs, so first we have to break our code into separate modules:

  • AddressForm.py— holds the AWT version of AddressForm

  • Address7.py— holds the address data code

  • AddressMain.py— holds the main window of the code

  • AddressFormPane.py— holds the AWT panel version of AddressForm

The first step is creating a frame that acts as the main window and then adding a list to it. Then we pack the frame and ...

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.