This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Record Reading Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Record Reading Problem" Watch "Record Reading Problem" New topic

Record Reading Problem

Dave McCarthy

Joined: Jun 12, 2001
Posts: 23
I recently just started the scjd project and I have been working mainly with the client side seeing I have no real programming experience. I have created a main GUI that on startup will display all database records (will not be this way in my final design - did this to get familiar with JTables). After selecting a flight to reserve seating on I have a pop-up window that displays only that database record and has a textfield to take the users requested number of seats. The problem I am having is that the single record has little squares next to the data in some of the fields. What could be causing this? Is this a suitable design for the GUI or could someone recommend something else?
I am using a hashtable to store the JTable row numbers associated with database keys and based on Jtable row selection retrieve the associated database record. Is there a better way of doing that? What would performance be like on a large scale using this method?
Any help is much appreciated.
Arvind Popli

Joined: Jul 30, 2001
Posts: 7
When u get the record data from the datafile, just trim the field values of spaces. This should get rid of the squares u get in the GUI.
Dave McCarthy

Joined: Jun 12, 2001
Posts: 23
Thank you for your reply...
I had just returned to post a reply that I had figured it out.
While trying to extract the avaiable seating I was getting an runtime exception where I was trying to cast the seating to an int. Did a trim on the string and everything worked fine.
Any comments on my gui design still welcomed/appreciated...

Thanks again...
I agree. Here's the link:
subject: Record Reading Problem
It's not a secret anymore!