Not closing file completely

I have writtten a program that you click a JButton and it reads the file to the last line and prints out in the JTextField the first 9 characters of the last line. I am trying to append to this file and have been successfuly witht eh write method in appending to the file. The problem is when I then go back and click on the JBUtton to read the file again it will not find the line that I just added. If I go to where the file is store and open and save the file and go back and run my program again, then it will read it. HOw can I make it read it once I add that line. It seems that the close() might not be workling. What do I do to completely close the file out.? I have done myFile.Close();

Here it is:
FlowLayout layout1 = new FlowLayout(FlowLayout.LEFT, 30, 40);
          row1.setLayout(layout1);
          row1.add(textLabel);
          lastProvider.setEditable(false);
          row1.add(lastProvider);
          row1.add(findProvider);
          findProvider.addActionListener(new ActionListener() {
               public void actionPerformed (ActionEvent e) {
                    if (e.getSource() == findProvider)
                    try {
                         FileReader newFile = new FileReader("C:\\Program Files\\ptAssignement\\patientListing.XLS");
                         BufferedReader newBuff = new BufferedReader(newFile);
                         boolean eof = false;
                    while (!eof) {
                         String line1 = newBuff.readLine();
                         if ( (line1.lastIndexOf(line1) > -1));
                         String newLastLine = line1.substring(0, 9);
                         lastProvider.setText(newLastLine);
                         newBuff.close();
                         } catch (IOException errors) {
          pane.add(row1);
     pane.add(row1);
          FlowLayout layout2 = new FlowLayout(FlowLayout.LEFT, 5, 65);
          row2.setLayout(layout2);
          pane.add(row2);
          FlowLayout layout3 = new FlowLayout(FlowLayout.LEFT, 10, 10);
          row3.setLayout(layout3);
          row3.add(providerAssignLabel);
          row2.add(patientListLabel);
          provider.addItem("MD # 1");
          provider.addItem("MD # 2");
          provider.addItem("MD # 3");
          provider.addItem("PA/NP # 1");
          provider.addActionListener(new ActionListener () {
          public void actionPerformed (ActionEvent e) {
          try {
          if (addToList.isSelected());
               BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\Program Files\\ptAssignement\\patientListing.XLS", true));
               bw.write((String)provider.getSelectedItem() + "\t");
               bw.newLine();
               bw.flush();
                    bw.close();
          lastProvider.setText((String)provider.getSelectedItem().toString());
          } catch (IOException err2) {
     row3.add(provider);
          row3.add(patientNameLabel);
          row3.add(patientNameText);
          row3.add(patientSsnLabel);
          row3.add(patientSsnText);
          pane.add(row3);

Similar Messages

  • Itunes not downloading files completely :/

    I am having a common problem- purchasing song files that end up not playing the complete song in the itunes player.
    I have deleted the song files from itunes, and downloaded them again via my purchase history in itunes store. Some songs play a little bit more than what the pervious download was, but still not complete. Does this mean I just have to keep downloading the songs again and again until I get lucky and obtain the full file(s)?
    I have emailed support but have not recieved a reply yet :/

    I can get the download page, but the section you need to actually get the download (where you put your e-mail) is replaced by one of those "can't connect/having difficulty to locate" pages.
    Have another try, diva. (I was getting that in IE 8, but the download controls are showing for me now.)

  • Batch command not closing files automatically

    Hi,
    Photoshop CS6
    Windows 7
    How do you make Photoshop automatically save and close a batch of raw files during batch runs?
    I'm just now trying the File>Automate>Batch command. I want to run an action on a bunch of .NEF raw files.
    How do you get rid of all the dialogs and just make the thing do the action? i.e., just OpenTheRawFile>RunTheAction>SaveAndClose>DoTheNextFile
    First it opened them all up one by one in Camera Raw and the ACR window stayed open until I clicked Open Image. So I checked Suppress File Open Options Dialog in the Batch command. That fixed that problem. But Batch left all the files open in Photoshop, didn't close any of them.
    So I went back into my action and added a file close. While recording the action I clicked Yes to save changes before closing the file.
    However, the batch now pops up that same dialog box after each file asking me if I want to save the file before exiting. This defeats the whole purpose of the Batch command.

    Do not use Batch, use one of the available Image Processor scripts instead.  If your RAW files have been converted before and have associated ACR setting, The RAW files will be converted  using these settings by ACR and ACR will bypass displaying its dialog. If the RAW files have no associated ACR settings the Image Processor scripts have an option that you can use to have the Image Processor open the first RAW file via ACR  where ACR will open its dialog. The settings you set will be used to convert all the RAW files processed in the current run of the Image Processor.
    Image Processor Pro is available on the web for downloading and is more flexible and powerful then the Image Processor that is shipped with Photoshop. You can set it up to save as many Image File for each file processed. The size and File Type you need.
    You can have the Image Processor Pro include in its process an action you create for file that are saved. It can be the same action or different action for each of the file save you set up.

  • Flash CC not closing files, but displaying confirmation message in the output panel

    Hi everyone,
    I have a JSFL file that basically iterates through some of the frames of an ordinary flash file to validate it has some specific frame labels inserted.
    The thing is, after I've ran this once against any flash file, no matter what the result is (either it finds the labels or it doesn't and it traces the result in the ouput panel) flash CC does this weird thing... I try to close any flash file I have open which has some unsaved modifications, and instead of prompting me if I want to save the changes, I see the message in the output panel:
    Save changes to "green_fire_dragon.fla"?
    So I can't actually close the file because I can't click OK! If I try to close Flash itself I get the same thing.
    Can anyone explain this? Thanks!
    PS: Not sure if it will make a difference but I can post the javascript code if necessary.

    Can you log a bug at :
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • CS6 not closing files out properly?

    I have a 2009 15" MacBook Pro (version 10.9.5)  that I take to work each day for my job. At work, we are connected to a 2012 server via an ethernet cable. I have issues overwriting files I'm currently working on (from Illustrator OR Photoshop, both CS6). An error message will pop up either saying I don't have permission, or a file error has occurred. To get around this issue, I save file locally to my computer then copy and paste them over, or I have to save multiple copies of a file under different names (ie: file_V1, file_V2) to the server. This will happen randomly and infrequently but not all the time - sometimes it's not an issue to save as I go or rename a file. Other issues outside of using Adobe software is renaming folders and files within the server as I will have similar results - sometimes I'm able and sometimes I don't have access/permission. I've spoken countless times to our IT guy who suggested I hit the forums. Any help would be great.

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Trying to email file from adobe reader 11.0 email addresses will not longer auto complete after moving to office 365

    trying to email file from adobe reader 11.0 email addresses will not longer auto complete after moving to office 365. It did work with older versions of outlook. Tried changing to global address book. It will only access global address book offline

    I have the same issue.  On a clean machine with Office 2013 64 bit installed.

  • After getting the dreaded gray/blue screen, I tried to run disk repair on the internal disk. I got an error message saying "Disk Utility can't repair this disk and restore your backed-up files. The volume Macintosh HD could not be verified completely

    After getting the dreaded gray/blue screen, I tried to run disk repair on the internal disk. I got an error message saying "Disk Utility can't repair this disk and restore your backed-up files. The volume Macintosh HD could not be verified completely." What do I do now? This is an iMac and I'm running 10.6.8.

    Clean Install of Snow Leopard
    Be sure to make a backup first because the following procedure will erase
    the drive and everything on it. See below for how to clone a drive.
         1. Boot the computer using the Snow Leopard Installer Disc or the Disc 1 that came
             with your computer.  Insert the disc into the optical drive and restart the computer.
             After the chime press and hold down the  "C" key.  Release the key when you see
             a small spinning gear appear below the dark gray Apple logo.
         2. After the installer loads select your language and click on the Continue
             button. When the menu bar appears select Disk Utility from the Utilities menu.
             After DU loads select the hard drive entry from the left side list (mfgr.'s ID and drive
             size.)  Click on the Partition tab in the DU main window.  Set the number of
             partitions to one (1) from the Partitions drop down menu, click on Options button
             and select GUID, click on OK, then set the format type to MacOS Extended
             (Journaled, if supported), then click on the Apply button.
         3. When the formatting has completed quit DU and return to the installer.  Proceed
             with the OS X installation and follow the directions included with the installer.
         4. When the installation has completed your computer will Restart into the Setup
             Assistant. Be sure you configure your initial admin account with the exact same
             username and password that you used on your old drive. After you finish Setup
             Assistant will complete the installation after which you will be running a fresh
             install of OS X.  You can now begin the update process by opening Software
             Update and installing all recommended updates to bring your installation current.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.
    You may be able to backup your data if you have an erased external drive you can use. Before you do the above but after you have opened Disk Utility you can try to clone your drive:
    Clone using Restore Option of Disk Utility
      1. Open Disk Utility.
      2. Select the destination volume from the left side list.
      3. Click on the Restore tab in the DU main window.
      4. Select the destination volume from the left side list and drag
           it to the Destination entry field.
      5. Select the source volume from the left side list and drag it to
          the Source entry field.
      6. Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup drive.
    Now this will only work if the drive is accessible and can be cloned by Disk Utility. Otherwise, you would need to access your drive from another Mac that you can connect via Firewire - Target Disk Mode.

  • How to completely delete all backed-up time machine files but not other files in my external hard drive?

    I use a 500G WD as my external.. I have documents and movies there that i do not want to delete. Simply i just want to delete my time machine files completely and for my mac to not recognised it as a time machine HD.. TY guys  p.s. A video would be nice

    If you have the external HD setup as one partition, you cannot delete only the TM files as a unit.  You will have to use the brute force method of deleting directory by directory.
    If you have the drive partitioned into a TM backup partition and another partition for your other work, you can simply reformat the TM backup partition.
    So, the first question is, how is your drive setup, as one or as two partitions?

  • Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Outlook 2013 are not opening and showing pst files are not closed properly

    Hi
    Outlook 2007 has stopped working and showing close the program. Again,we re-started then outlook 2007 and it has opened and taken the backup of pst files in a separate hard drive.
    The pst file was repaired in scanpst.exe and again i have tried to put the pst file back in outlook 2007.It was hanging and suddenly i have uninstalled 2007 and started installing outlook 2013.
    2013 applications like word,excel,power point are opening and outlook 2013 are not able to open and showing pst files were not closed properly.
    Again i have un-installed and re-installed the outlook 2013.still we are not able to open the outlook.
    Need your support at the earliest to fix the issue.
    Thanks

    Hi,
    What's the .pst file used for? Archive? Or you set up a POP3 account and want to import the emails from the .pst file?
    Another question, you mentioned you installed Outlook 2013 and it didn't open either. Was this from the beginning right after you installed Outlook 2013, or after you did something such as create a new Profile, set up a new account and tried to import the
    .pst file?
    Kindly answer my questions so I can understand the situation better.
    I've seen some of this issue caused by the anti-malware software, check your anti-malware software to see if it's trying to interfere with Outlook - things like real time email checking can sometimes cause these kinds of problems. To troubleshoot, we can
    simply disable the anti-malware software temporarily to see the result.
    Regards,
    Melon Chen
    TechNet Community Support

  • Getting Files off CD-RW that is not Closed

    Hi,
    I have an issue that is new to me. My dad has a CD of a music concert his chorus performed that was captured from the mixing board to a CD writer of some sort. The result was a CD that has a single session that is marked as Open when I look at the disk in Toast.
    He had 2 such CDs but I closed the session and finalized one disk by burning an additional file on it. That closed the disk and I could see the 2 sessions (as different volumes) and get the audio files off the disk. However, the second CD seems to have run out of room for me to try that trick again. I tried to copy an empty file created by the "touch" command (probably about 4k in size since nothing is every empty in size) it tells me there is ~600k to write and only about 300k available. Toast tells me there is 702MB of data on the disk already (and CDs only say they hold 700MB so I'm assuming it's at the limit).
    So the big question is whether I can use Terminal or some other means to just grab the files from the disk even though the session is open and the disk is not closed. Has anyone run into this before or a way around it? Since the Finder will not mount the open session I can't see it in the /Volumes folder to copy from it. Disk Utility wants to erase the disk and Toast can see the disk and if I had room I could write more to it.
    Any help or ideas anyone has is appreciated.
    Thanks,
    Sean

    Give this one a try....
    http://mac.softpedia.com/get/Utilities/Dragon-Burn.shtml
    Do just run it and go.....and do a fresh restart, run that app, then feed the CD - all in one shot, right after a reboot and don't run any other burn apps, feed in any other disks, etc.
    If it mounts for DragonBurn, immediately create an image, then burn that to a blank DVD or export audio tracks to iTunes...don't try to pack it all back onto a CD.

  • Upon opening Outlook 2003 get message "Not closed properly. File is being checked for erros."

    When opening Outlook 2003 get an error message stating that is was not closed propertly and that the file is being checked. It can sometimes take up to 5-10
    minutes for outlook to open. How can I stop this?

    You need to figure out why Outlook is not closing property. The usual culprits are addins that access Outlook data. 
    Are you closing outlook before shutting down windows? If you let windows shut it down, you can corrupt the pst. 
    Does it work better in Safe mode? To open Outlook in Safe mode: Close Outlook then hold Ctrl as you click on the Outlook icon. You'll get a message asking if you want to start in Safe mode. Click Ok. 
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • Unexpected end of file has occurred. The following elements are not closed

    My installation of UPK has decided to stop working with the following error;
    Unexpected end of file has occurred. The following elements are not closed: Storage. Line 3, position 1.
    We've uninstalled and reinstalled the application and have the same error.
    Any insight into this error is apprectiated.
    A

    Verify from Compatibility between Office 365 MP and Management Server because this issue related to error in MP that you imported. And i think you use below link which is compatible with Management server 2007 R2 cu4 not SCOM 2012 R2
    http://www.systemcentercentral.com/scom-monitoring-office-365/
    Also you can refer to below link
    http://thoughtsonopsmgr.blogspot.com/2011/09/scom-and-office-365.html
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer".

  • Any news about Mountain Lion not closing open files / folders on smb server shares?

    Hey Apple, anyone listening?
    Are there any new about this issue, where Mac clients cannot move/edit/rename each others files and folders on a smb server share? We are a graphics work group in an otherwise Windows-centered enterprise. We have mac clients with OS X 10.5.8, 10.6.8, and recently 10.8.5. None of the older clients can work with files or folders created by the new machine, meaning that InDesign files will open read only, files and folders cannot be moved or renamed. This is absolutely critical in a flexible work environment, where any graphics designer must be able to jump into any other project on short notice.
    As mentioned in other threads around the web, this seems to be a problem not with file permissions but with the finder not releasing/closing files and folders correctly when not actually in use. (a known issue is the fact, that i.e. Acrobat pdf must not be viewed in column views preview, if anyone else wants to overwrite that file, but this issue here goes much further). We urgently need a fix for that!
    I'm really desparate about this topic, since the IT-department is already reluctant to offer mac support and to look into these problems; if there is no solution to this, we will be switched to windows workstations by the end of the year ... Apple, do you want that? We surely don't!
    A frustrated user

    Hi,
    thanks for your answer. Does that mean, that there is a solution to this on the server side?  Is this ACL stuff a matter of setting up the server correctly, rather than a problem with mountain lion's networking?
    If i could be sure about this, I would approach our IT department... (the are just waiting for some Mac User pestering them ) ...

  • "Could not save (file name) because the file is already in use or left open."

    Hello,
    When I tried save as a file, I get an error msg:
    "Could not save (file name) because the file is already in use or left open."
    The file is not open anywhere accept Photoshop.
    Mac Pro, OSX 10.5.6
    Photoshop CS4.
    I searched the forum but could not find anything even though i'm sure someone already asked it.
    would love to get a solution for that.
    thank you,
    shlomit

    There is a problem with both Photoshop and InDesign, then we can blame wich ever it is.
    1. I open a .psd file in Photoshop CS4 by double clicking it in Bridge
    2. This image is placed on a page in a open InDesign document.
    3. Doing some changes in Photoshop on the image.
    4. Trying to save and get this error message (this topics subject)
    5. Deleting the image from the page in ID doc, it is the only one in the document.
    6. Can't still save file.
    7. Closing ID completely and now I am able to save the file.
    I tried turning of Live preflight in Indegisn but that didn't help.
    So probably the fault is InDesign or the MacOS. I didn't have this problem with CS3. It is a stupid problem because this type of workflow is pretty common and one would expect it to be solved by now.
    Jan Suhr
    Stockholm, Sweden

Maybe you are looking for

  • Error 403 when I try to connect to iCloud

    I recently bought a used iphone 4 (iOS 7.0.4) and when I try to connect this iphone to icloud with my apple username and password, I get an error 403 (I haven't got any icloud account before). When I try to create a new icloud account, It tells me th

  • TS1539 Will itunes allow the syncing of a motorola slvr 7 on my windows xp system?  If so, how do I do it? I want to sync to itunes

    I have an old Motorola SLVR 7 phone that I was able to download/sync 100 songs from my itunes.  Now I can't.  The SLVR doesn't show up on itunes any longer.  Is there any way I can.  I have Windows XP. Thanks.

  • Deleting old versions of PhotoShop Elements

    Jeez, all kinds of hoops to jump through just to get one stupid question answered. I just installed PhotoShop Elements 12. Is it safe to delete my old version, PhotoShop Elements 8, from my hard drive? P.S. Does anyone know why I had to submit my bir

  • Edit to tape INSERT & NO AUDIO

    Ok, so i have a brand new Mac, Decklink Blackmagic Extreme HD card in it. Everything works properly, except the insert edit to tape. When I perform an assemble edit through the "Edit to tape" window it works fine, but cannot get the insert edit to in

  • IPhoto 11 a step back-

    Well first of all, I love Apple products, but iPhoto 11 is a step back compared to the predecessor. The way how one is using iPhoto 11 got more complicated, not intuitive and it feels so sluggish. Like a cheap Microsoft copy of iPhoto- Really, the mo