Adding an Input Form for an Address Entry: First Cut

At this point, you probably feel comfortable with the concepts the prototype introduces. To incorporate these concepts into the address book program, let's organize our code into a class called AddressForm. This class extends the javax.swing.JFrame class, which makes it a JFrame.

AddressForm is passed an instance of the Address class in its constructor. okayHandler() populates the fields of the instance with values extracted from AddressForm's text fields. Look at Address6.py below and make sure to read all of the comments.

 from javax.swing import JFrame, JButton, JTextField, JLabel, JPanel from java.awt import BorderLayout, GridLayout # 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.