File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Saving GUI info. to files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Saving GUI info. to files" Watch "Saving GUI info. to files" New topic
Author

Saving GUI info. to files

greg burgess
Greenhorn

Joined: Nov 28, 2001
Posts: 3
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

Joined: Dec 10, 2001
Posts: 7023
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.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
greg burgess
Greenhorn

Joined: Nov 28, 2001
Posts: 3
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Saving GUI info. to files