File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Need help with a record management app. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need help with a record management app." Watch "Need help with a record management app." New topic
Author

Need help with a record management app.

Nafiz Sheikh
Greenhorn

Joined: Dec 14, 2011
Posts: 4
Hi, everyone.

I need some help designing an application. The application manages student records. Each record of a student contains his/her name, ID number, grade, and major. The application is supposed to be a GUI. The user should be able to add/delete/modify records and once done the records have to be saved in a text file with of the five record fields separated by commas; the records are to be separated by lines.

What approach should I employ when integrating the GUI function and the data management part? I was thinking of creating the following:


If this pic doesn't show, I've attached a copy directly as well.

There is a control panel at the very top of the window with the add/delete record buttons. Then below that, there is the main panel where all the records are displayed. This panel has five headers as individual JLabels, and then has a series or record panels as JPanels with five JTextfields in each. For the GUI part I have the following questions:

1. Is there a simpler way of representing the student records graphically? Would JTable do the trick or should I try this way? I have never worked very thoroughly with JTable before so I'm not sure if it may suit my needs or not.
2. Suppose I create a class called Record which takes the five field arguments and has getter/setter methods. Each Record instance is associated with one student. With JTable, would it be possible to associate each row with a single Record object? Or would I have to treat each cell in the JTable as independent units and later when I need to save the typed data, take all the cells in each row and associate them with a student Record object?

When saving the information provided by the user into a data file, I have to place each student record on a different line and each line has each of the five fields of info separated by commas. Example:
////////////////////////////////////////////////////////////////////
Bill Carson,14222,2307 Hill Way Dr.,98.5,Mech. Engineering
Joyce Mendoza,16667,666 Durham Rd.,78.5,Chemistry
/////////////////////////////////////////////////////////////////////


These questions pertain to when I have to save the data typed by the user into the records:

1. When collecting the data, assuming that I use JTable, how should I organize and save the data? Should I take the info in each row, store them in a Record object associated with one student, and then retrieve the info from each Record object and save as a line in the data file?
2. OR is the a simpler way to organize the data. Some have mentioned using the Hashmap, Hashtable, or other collection-type classes here but I have no idea how such may be. Can you please explain how that may be so?

NOTE that all the methods used have to be resource and time efficient, as well!

Thanks so much for going through the trouble or reading this and I REALLY would appreciated if someone could please help me with my problem.


Please forgive me if I've posted this in the wrong category, this is actually my first time using this forum, so I'm definitely a newbie.


[Thumbnail for Java1.png]

Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3534
    
  15
Nafiz Sheikh wrote:I have never worked very thoroughly with JTable before

This is probably a good place to start then.


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38802
    
  23
And welcome to the Ranch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with a record management app.