Developing a user interface

Now that you have some familiarity with the various graphical components which are available you need to know how to get them to interact with each other to achieve your application's goals.

In this section you will learn:

  • How to go about developing interacting components and panels
  • How to define a scrollable, selectable list of objects
  • How to add objects to a list
  • Hot to amend objects in a list
  • How to remove objects from a list

Developing interacting components and panels

This section will demonstrate an approach to developing independent yet interacting panels typical of real-world applications, albeit much simplified to focus on the principles involved.

You will return to the ZooKeeper class you developed previously and create a desktop application that enables the zoo administrator to create, edit or remove individual zookeepers.

This part of the application will look like this:

Administrator frame

The tab consists of:

  • The title "Zookeepers". Later, you will develop other tabs to contain section for animals and visitors;
  • A selection list of zookeepers, initially empty
  • A editor panel where you can add or change a zoo keeper's details by entering them into the entry fields and click the Save button
  • A sliding divider between the zookeeper list and zoo keeper editor panels
  • A button bar at the bottom with buttons to allow you to clear the form to add a new zookeeper, or remove the selected one from the list

You will also use the NetBeans GUI builder (known as "Matisse") to help build the graphical layouts for the main panels.