Table of Contents

Inheritance and GUIs


Quoting from a commentary on teaching GUIs:

“Although inheritance is very important to understand, it isn't used that often. One of the few places where it is used to great advantage is in GUIs. The GUI system can and should be used as a real, not contrived, example of inheritance.”


Overview of GUI Skills to Learn

Read-Compute-Write Versus Event-Driven Programming


GUIs and OOP


GUIs and Listeners

Example: Dog years (w/ no listener)

Complete steps to create a GUI

1 - Create and initialize components
2 - Create content pane and set its layout
3 - Add components to content pane
4 - Set window characteristics and pack it

Example: Dog years (with listener)

        convertBtn.addActionListener(new ConvertBtnListener());
        class ConvertBtnListener implements ActionListener