My Board

General => General Discussion => Topic started by: crypticknight on April 25, 2006, 08:43:57 AM

Title: I need some help.....*prays to the God of Java*
Post by: crypticknight on April 25, 2006, 08:43:57 AM
ok so heres the thing i have my final project in advanced java due thursday....we just got it today.
-------------------------------------
Directions:

traveloutput file:
  modify project 6 so that the data captured is placed in "travel.dat" data file.
  capture at least 5 records

travel input file:
 create a small program that opens the "travel.dat" file and reads the data file to a JOptionPane dialog box in summary format using toString() method.

You may send the data to the file using either a "plain text" format or "serialization/object" format.
--------------------------------------

Now with that said, the teacher said it was only like 10 lines of code or so to add....but i have no idea how to do it.

Posted below is the source.....if anyone could help i would be extremely greatful.
http://www.georgiasouthern.edu/~bhobbs3/Proj6.java (http://www.georgiasouthern.edu/~bhobbs3/Proj6.java)
Title: I need some help.....*prays to the God of Java*
Post by: Balaso on April 25, 2006, 12:21:44 PM
That sounds like a job for the cookiemonster!! Hopefully he sees this, he is the residance coding guru.
Title: I need some help.....*prays to the God of Java*
Post by: sK_Cookie on April 26, 2006, 05:55:45 PM
cryptic yes this realtively easy.  Not sure what you code looks like but you need to make your class serialized and implement outputstringbuffer.  I will tell you that there is alot of info in the API docs with examples for this one.  Look at the fileoutputstream and serialized string buffer.  There is something else im forgetting here.  Give me a few and I will look up the exact names for you with links to the info in api docs on java.sun.com website.
Title: I need some help.....*prays to the God of Java*
Post by: sK_Cookie on April 26, 2006, 06:01:55 PM
okay found it this is exactly what you need and all the docs you should need on it

http://java.sun.com/j2se/1.5.0/docs/api/ja...FileReader.html (http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileReader.html)

The class you will call is filereader to read the characters in the flat file.

just in cass you dont have this link this is to the main docs in case you need further info inorder to make it work with in the program you already have.

http://java.sun.com/j2se/1.5.0/docs/api/ (http://java.sun.com/j2se/1.5.0/docs/api/)

if there is anything else I can help you with let me know.  I dont know if I will be able to get back on the forums tonight but you can call me I pmed you the number
Title: I need some help.....*prays to the God of Java*
Post by: E.J.FUDD on April 26, 2006, 06:17:04 PM
yea what he said.... |)