Program is OK but No text is written to File

Hi every one
I am trying the following code but it does not function
it opens file to write or
if it exists it appends text to the file.
DataOutputStream dos;
Vector vc;
* Utility method to write a given text to a file
public boolean writeToFile(String fileName, String dataLine,
boolean isAppendMode, boolean isNewLine) {
if (isNewLine) {
dataLine = "\n" + dataLine;
try
File outFile = new File(fileName);
if (isAppendMode)
dos = new DataOutputStream(new FileOutputStream(fileName, true));
else
dos = new DataOutputStream(new FileOutputStream(outFile));
dos.writeBytes(dataLine);
dos.close();
} catch (FileNotFoundException ex) {
return (false);
} catch (IOException ex) {
return (false);
return (true);
this method
Writes data from an input vector to a given file
public void vectorToFile(Vector v, String fileName)
for (int i = 0; i < v.size(); i++) {
writeToFile(fileName, (String) v.elementAt(i), true, true);
it calls the method writeToFile(fileName, (String) v.elementAt(i), true, true) .
The problem is that nothing is written to the file.
BTW: I copied the following methods from the following site:
http://www.java2s.com
I am trying to use it within my program.
by doing the following at the
public static void main(String[] args)
Vector vc = new Vector(10);
myProgramm calling = new myProgramm ();
calling.vectorToFile("employee34.txt",vc);
Any clues
Thank you so much

What IDE are you using, the first thing I would do is start to debug the application to make sure that all the methods are being called and that no method is exiting from somewere without you want it to.

Similar Messages

  • Text displaying selectively, and programs not letting you input text

    I posted here once before under a different name when my internet wasn't working and got a prompt, exceedingly detailed and very useful response. Hopefully another brilliant Mac user can help me this time!
    As you can see I have an intel-core solo Mac mini. I love it very much, but recently text has been display in an unusual way. Sometimes, in some programs, certain letters will not display. http://tinyurl.com/ygmhc4 is a collage thing I just made to show what I mean more clearly. This happens in MSN, in system. . .programs, I guess, in Firefox, in Growl notification, in Google Notifier, all over the place! I haven't noticed it in MS Word yet, though, but I don't use it often. It's really quite annoying. Any thoughts? It tends to be different letters, but for example all lower-case Us will disappear. But next time, it will be all capital Hs and lowercase Fs. And if you close the program and reopen, it sometimes displays correctly! In Firefox, sometimes entire passages of text will not appear, unless I change the text size to very small sizes. How perplexing!
    And another issue I have had: Sometimes a program like Firefox will not recognize ANY keyboard input unless I switch to another application, and then back again. It's a minor annoyance, but it happens pretty regularly.
    Help with either issue would be GREATLY appreciated as while both are not destroying my machine, they are harming my productivity. Thanks SO MUCH!

    Oh and another display issue, although this MAY be a Firefox problem as it only happens in Firefox. Then again, it seems my computer is really having trouble with text.
    Here it is: when I am entering text in to a textbox, the text-entry cursor is slower than the text I am entering. For example, see http://tinyurl.com/yakrlp
    In that box, I typed "Unfortunately, this is not the end of my crazy text-display issues! I can't see the last couple of letters I've typed until I type severl mare after them causing ridiculous typos like those because It'it's too late! And I dont't know how many backspaces to do because the cursor is in the wrong place. Annoying, huh? Let me tell you it is. Perhaps this is a Firefox issue, but it seems like it isn't."
    As you can see, this is causing a lot of problems. It only appears on SOME websites. For example, on this site, entering this text, it's fine. On some forums, like the MozillaZine support forum, and also in Gmail, this problem appears. Please help! Or is this a Firefox issue?
    It seems I have a lot of problems!

  • I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    I have acrobat pro on my lap top and recently installed acrobat pro on my Mac Mini, but the text recognition function is not working, does anyone have any advice on how to remedy this problem?

    On my laptop when I open up a pdf file and do a search for a particular
    text phrase it prompts me to run a character analysis.  Whereas on my mac
    mini, when I try to engage the same process it just says it couldn't find
    the phrase and doesn't even try and run a character analysis. I tried
    clicking on the tool bar and the recognize text tab but nothing there seems
    to do anything.
    In trying to figure out the issue on my own I noticed one thing.  I run a
    small law firm in St. Louis and I scan in all my files to which are
    subsequently emailed to my outlook account where I will save them as pdf's
    to their respective folders.  On my laptop when I open up an email from my
    scanner I see the image of a acrobat document next to the attachment
    paperclip symbol.  However, when I open up the same email on my mac mini I
    notice instead of an acrobat file image it shows a Preview file image (the
    program used to open up pdf's before I installed acrobat).
    Hope this helps!
    Sincerely,
    Jonathan McAllister

  • I send an email from my Iphone to a friend.  My friend receives it on her Iphone, but as text message.  She replies and it goes back to my daughter's phone, a completely different email and phone number.  Why?

    I send an email from my Iphone to a friend.  My friend receives it on her Iphone, but as text message.  She replies and it goes back to my daughter's phone, a completely different email and phone number.  Why?

    We went through my friend's phone and my daughter's email and phone number are not in it.  I have never given my daughter's iphone number to my friend.  Is it something to do with gmail or my apple id?  My daughter (14) has been using my computer as her "base" for HER Iphone. 
    My friend does use her iphone number as an email address as well.
    For instance:  her phone number might look like this:  (493) 305-3958
    and her email address would look like this:  [email protected]
    If I Iphone/email my friend, she receives it as a text message.  Then if she replies to that text message, it goes to my daughter's phone and not mine.  It's completely crazy!  We searched her phone contacts and did not find my daughter's phone number anywhere or attached anywhere to mine.  Since when does Iphone emailing wind up in the text messaging area?

  • I am trying to use motion tracking to have text follow a section of the background.The text box follows the motion path, but the text just sits there.  What am I doing wrong?

    I am trying to use motion tracking to have text follow a section of the background.The text box follows the motion path, but the text just sits there.  What am I doing wrong?

    Motion basically looks at the the source footage and it's timing (in the timing section of the Inspector) when analyzing for tracking.  Filters are basically ignored by the tracker.  Retiming actions, like time re-mapping, or retiming behaviors that are applied before the tracker should be used by the tracker.  Did you change the timing after doing the tracking?  If so this would also require you to re-track the shot.  Understanding that you found a workaround, describing the effects you applied would help to explain why you ran into problems.
    Cheers!

  • I put some programe in icloud but not my account how can i re enstole again in my iphone but in my account in apple plese help my

    I put some programe in icloud but not my account how can i re enstole again in my iphone but in my account in apple plese help my

    Please help me??????

  • Can you choose to block phone calls but not texts from a number?

    So I have searched all over the place and have not found an answer.  I am sure someone has blocked me from calling them because when I try to call them I recieve this message: "Welcome to Verizon Wireless. The number you were trying to reach has calling restrictions which has prevented the completion of your call."However I am wondering if they can still receieve my texts.  I have sent two and they both show that they have been delivered on my phone and they both also show up on my online bill as having been sent from me and recieved to the number that I am pretty sure has blocked me.  Does Verizon allow someone to block just phone calls but not text messages?  Or if you block a number from calling does that mean texting from that same number is automatically blocked as well (or is it two seperate processes)?  I understand it may look like it has been sent on my end, but I am wondering, since I never got a "message failed" indicator or anything else telling me they never got it, if they were able to receive and read the 2 messages?  We both are Verizon customers by the way.  Thanks!!!

    That person did block you, and no they cannot receive or read your texts.

  • My iphone 5 went into search mode and I can't place or receive calls or use the internet but my text messages work. Sprint had me do a master reset and my phone doesn't work at all now I can't get it past the activation. Will I have to pay in store?

    My iphone 5 went into search mode and I can't place or receive calls or use the internet but my text messages work. Sprint had me do a master reset and my phone doesn't work at all now I can't get it past the activation. Will I have to pay for repairs in store because I didnt get the Apple care plan when I purchased it. Sprint said it may be a phone problem not sure if I should take it to Sprint or Apple...I just need my phone

    I'm sorry to learn that you are not able to make/receive calls chelseabee! (ticket number removed) results indicate that there is no issues with the network or account provisioning. Since you have already done a hard reset http://vz.to/1gBkSJc (as per your post), I recommend exploring replacement options. If your phone is within the one year manufacturers' warranty we can provide a Certified Like New replacement http://vz.to/uyYF0o as long as no physical/liquid damage exist. If your phone has sustained physical/water damage and you have insurance, you can submit a claim to the insurance company online at this link http://bit.ly/07CrqPK
    AntonioC_VZW Follow us on Twitter at www.twitter.com/VZWSupport
    >> Edited to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • When I send emails using my iPad, recipients are telling me that I am sending them blank emails.  I've had some of them forward the emails back to me so I can take a look and it seems that my message is actually there but the text is white...

    When I send emails using my iPad, some recipients are telling me that I am sending them blank emails.  I've had some of them forward the emails back to me so I can take a look and it seems that my message is actually there but the text is white.  Interestingly enough, I was a Windows user just a few months ago and I was on the receiving end of this same problem with someone who was sending emails from her iPhone.  I don't believe it is happening every time but if it happens even once it's a problem.  Any idea what's going on? 

    Oddly enough, having reported the problem it appears to have fixed itself. There may be some combination swipe gesture that triggers it is all I can think because I suddenly manged to zoom my display x3 by double tapping three fingers. Took me a while to sort this out but then when I got back home I could suddenly see all my emails again. Bizarre!

  • Synchronization from SLD to LMDB is working fine, but data is not written to Software == Product Instance

    Dear Gurus,
    Synchronization from SLD to LMDB is working fine, but data is not written to Software ==> Product Instance section tab. What could be the problem ? Normally it should gather automatically, but pushed me to select manually lots of component ???
    Here is collecting is working fine !!!

    Hello Kemal,
    You have to ensure that your Technical System info is properly filled automatically.
    In LMDB you first create its Product System on LMDB Start Screen ProductSystem tab, after that please assign its respective Technical System. You probably need to run the Verification Check in order to confirm that your Product System has all Product Instances according on Technical System's Software Component Versions.
    Regards.
    Luis Roel

  • Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the sam

    Letter-Spacing is different if I open my file at another Mac of us (Value is at both mac 0, but the text is longor), and if I cklick into the text-box, Illustrator says that the file was made in an other Version of Illustrator. We have on all macs the same system, os 10.8.3, cs6 and UTC4. And of course we`re using exactly the same font....

    Packpool,
    I believe the first thing to do is to update to 16.0.5.
    Adobe - Illustrator : For Macintosh

  • I purchased and installed the Photoshop Photography Program last year but my computer crashed and now I need to re-install it again...can someone help?

    I purchased and installed the Photoshop Photography Program last year but my computer crashed and now I need to re-install it again...can someone help?

    Hi Sangeeta,
    For a fresh download on a new hard drive, it's best to start with the CC desktop app. Sign into adobe.com and download it here: creative.adobe.com/products/download/creative-cloud
    You can then launch the desktop, sign in and download PS & LR.

  • When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. pleas

    When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. please re install of repair the application and try again. I have done this and it's still not working                  

    anomaly jade,
    You only need to use the serial number during installation.
    Have you, at least seemingly, been able to install, and then you are unable to start up?
    If that is the case, you could try to reinstall using the full three step way:
    Uninstall, run the Cleaner Tool, and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Export PDF Rasterize Vectors but retain text

    I'm running ID3 on 10.5.7 I have a file which is over 100pp and is very vector graphic heavy. My PDF's are coming out at 7.4MB on the smallest file size setting. I know I can raster the whole page but this makes alos makes the file size to big. What I want to do is have a half way setting and rasterize the vectors only and retain the text.
    Is this possible? Can someone explain to me how to achieve this without going back and saving out all images from Illustrator as JPEG's and replaceing them in InDesign?

    There was another thread about this just yesterday. http://forums.adobe.com/message/2090197#2090197
    There was a comment in this link http://indesignsecrets.com/creating-smaller-pdfs-from-a-vector-dense-book.php that seemed to indicate you could rasterize the vector graphics, but not the text, by adjusting the balance in the flattener.

  • I am a computer novice, but how do I change text in a pdf file?

    I am a computer novice, but how do I change text in a pdf file that was sent to me?

    I would try Acrobat out, you can't do that in Adobe Reader.

Maybe you are looking for