Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving GUI info. to files

 
greg burgess
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys I appear to ba having a problem connecting my GUI with a data recorder class(vector).If i run a dos test it prints out each object within the vector however if I run it with my GUI application it fills the vector with copies of the last object entered.
the record = new PersonDetails(aname,ahouse,aphone)
avector.addPerson(aperson);
for adding the object to the vector however the button for saving all the records appears to throw up a problem.
In the dos test
if(another.equals("YES"))
{
avector.addPerson(aperson);
}
else
{
avector.addPerson(aperson);
exit=true;
}
}while(!exit)
}
avector.save();
avector.load(); works well!!
I've been working on this problem all weekend the file I want to put the record out to cannot be read.
If anyone can help I would be most grateful.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same logic would seem to apply to a GUI application as well. That is, unless when you say "GUI" you actually mean "Applet". An Applet cannot read files on the user's computer (unless you're getting into signing things).
The best way to help you locate what's wrong in your GUI application, would be for you to first post the relevant code of the GUI application.
Good Luck.
 
greg burgess
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some of the GUI
in constructing a "Save customer" button
If I select the appropriate textfields for the relevant classes such as String pdetails = namefield.getText();etc
aperson.setName(pdetails);
....
aperson = new PersonRecord(aperson,hdetails,phone)
arecorder.addPerson(actor);
However at the end of a shift I want to then save all the records not one at a time
so in my DataRecorder class I have a save() Method

Thanks G
[ April 28, 2002: Message edited by: Dirk Schreckmann ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic