Sunday, February 13, 2011

Java Swing applications -- Telephone and Address Book -- I

Before starting the design and implementation of Telephone cum Address Book, I recommend you to go through the following post which gives an insight of how a layout should be in Java Swing.
How to choose a layout in Java Swing

It is quite common to have a telephone book to note the contact numbers, addresses and other notes of relatives, colleagues, acquaintances and so on. The search operation still has be improved under such circumstances. We need to find the contact quickly in the telephone-contacts book. In addition to that, updation, deletion of contacts is quite cumbersome in such circumstances. I have come up with a typical CRUD (Create, Read, Update, Delete) kind of an application built on Java -- a Java Swing application to be precise, which provides the following:
  1. Create / Add a new contact to the Telephone book
  2. Update the details of a contact
  3. Delete the contact details
  4. Search functionality based on many parameters such as Name, City, Contact Numbers, Address etc.
  5. List the entire list of contacts
  6. Refresh capability for the changes to be applied to the database.

Advantages over the normal telephone book:

  1. Quick search and display of details
  2. Easy updation and deletion of contacts
  3. Robust contact addition

User Interface Analysis and Design:

The entire application is built on tabs, rather than using Menus and sub-menus in the application as most of them do. But to avoid complexity in the application, the results are maintained in tabs (JPanel). The results of the search and listing functionality are displayed in a Scroll Pane (JScrollPane). The items in individual panels are programmed in separate functions to provide easy maintainability. There are 5 panels in the application which are listed below:
  1. Create Panel
  2. Delete Panel
  3. Update Panel
  4. Search Panel
  5. List Panel
The search results and the listing operations are displayed in a tabular format (JTable), with 7 different contact details. The operations on the table can be made by clicking on that particular cell and deleting the corresponding record. The table is added to the Scroll Pane (JScrollPane) with vertical and horizontal scroll bars as needed.

The form-elements in the panels such as Create, Update and Search Panels is arranged in Grid Layout. Go through the guidelines to use Grid Layout. All the guidelines listed to use Grid Layout will have to be followed for better look and feel. The text-boxes (JTextArea) and buttons (JButton) are mainly used in all these forms, with the drop-down lists (JComboBox) also being added to the Search and Update Panels for better functionality and ease of use. The screen-shots can be downloaded here.

Database Analysis and Design:

This is a simple application with only a few contact-details which allows us to design the entire database using a single table. The main motto of this series of posts is to work with Java Swing and database is the easiest way to access data. So, we make an assumption that a contact has only single Office, Residence and Mobile contact numbers. The Normalization is not needed as per this assumption and a single table prevents the joining of tables. The database table telephone consists of fields listed below:
  1. Contact-Name
  2. Street, Area and City details of the person's residence
  3. Office, Residence and Mobile phone numbers 

14 comments:

  1. Acc. to me the database stuff is a bit wrong.A person may have several mobile numbers.In order to correctly implement such an input,you should normalize the table properly which would result in several smaller ones.A single table will not result in correct normalization.
    It would be even more useful if it is an online application developed such that the searching is done dynamically without the need for the uesr to press some button(i dint see your screenshots,so i guess it works with a button and it should not be that way.If it is not that way,forget the last line).Hope this is helpful. :)

    ReplyDelete
  2. Yes..I did not consider this particular situation and with the number portability, this idea is completely out of my reach...however will try and change it....

    ReplyDelete
  3. Please send me the project. I need this project. My email adress damianionuttiberiu@yahoo.com

    ReplyDelete
  4. damianionuttiberiu@yahoo.comNovember 9, 2011 at 10:00 PM

    please send the project adress book, please, at damianionuttiberiu@yahoo.com

    ReplyDelete
  5. The link for project is provided in the next part. Otherise it can be found at http://sites.google.com/site/welcome2terminal

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...