RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 3188 | Replies: 3
Reply
Join Date: Jul 2005
Posts: 4
Reputation: ripdeath987 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ripdeath987 ripdeath987 is offline Offline
Newbie Poster

Help Java multiple text file saving

  #1  
Jul 22nd, 2005
I am making a Java application and I can't make it save multiple text files. The program must save a different file everytime the save button is pressed. Can it be done?
I thank you in advance
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,749
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Java multiple text file saving

  #2  
Jul 22nd, 2005
yup, can be done easily.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Jul 2005
Posts: 56
Reputation: Sauce is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Sauce Sauce is offline Offline
Junior Poster in Training

Re: Java multiple text file saving

  #3  
Jul 22nd, 2005
Here is some partial code to help out a little more...
private String baseFileName = "junk";
private int i = 0;
public void save()
{
       String tempFileName = baseFileName + (i++) + ".txt";
       // Insert Stream Declaration Stuff       
       // Insert Code to Save File
       // Close Streams
}
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Java multiple text file saving

  #4  
Jul 22nd, 2005
Hi everyone,

Simply you can put you text in a jtextarea and use the write api for the jtextarea to save the text but if you are using a jtextpane then you can use the
object stream or rtf kit to read and write. Check out their invidual api's for details.

Try to yahoo for them as there are a lot of different of stream format of doing things.

Richard West

ps. Don't foget to answer the thread on the bottom of my signature
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:30 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC