tel e phone \tel'e-fon'\ n: an electronic device or system for sound reception or reproduction at a distance
Welcome to your fifth sample intranet application. If you thought the last program-the Online In/Out Board-was simple, wait until you see this application. This is the Online Employee Phonebook.
This read-only application displays the phone numbers of employees in a scrolling list. This is useful for all employees to look up the phone numbers of their coworkers.
This chapter will cover the following topics in regards to the Online Employee Phonebook application:
This four step format will be used throughout all of the sample application chapters. Hopefully, it will provide you with valuable insight and ideas for creating your own intranet applications.
This application, like the last, is one of the simpler applications in the book. Once this application has been connected to a data source, it will present the user with a list of all the employees on file, as well as their phone numbers and names formatted in an attractive manner.
Figure 17.1 is the proposed user interface for the Online Employee Phonebook program.
Figure 17.1 : The Online Employee Phonebook user interface.
The interface will utilize a JifTextArea component to display employees and their phone numbers, and a single Refresh button to refresh the list.
The list needs to be refreshed periodically. The Refresh button is just the ticket. By pressing that button, the user initiates the process of reloading the JifTextArea.
This application utilizes the employee table that was defined in Chapter 13, "Employee Files." There really is nothing new here. The application retrieves the rows from the table and displays the data.
In the rest of this chapter I will discuss the implementation of the Online Employee Phonebook program. I'll first discuss the user interface and how it was created. Secondly, I'll discuss the database access used in the program. Finally, I'll cover any programming pitfalls that came up during the application construction.
Each sample application in this book uses a different approach to developing the user interface. This variety will show you the different ways you can go about doing your own interfaces. Hopefully, you will get a nice cross-section of many different styles and choose the one that suits you the best.
To achieve the design goal presented above, you do not need special
user interface components. The stock BorderLayout
is sufficient. You'll also employ the JifTextArea
class and a button.