Problem with saving file

Hi,
I get no error while compiling, but the file is empty after trying to save data to it.
Heres the code:
ButtonClick:
    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {                                          
        Methods metodai = new Methods();
        ArrayList sarasas = new ArrayList();
        PrintWriter fRaso = null;
        try {
                    JFileChooser fc = new JFileChooser(".");
                    fc.setDialogTitle("Prints results to file");
                    int rez = fc.showSaveDialog(null);
                    if (rez == JFileChooser.APPROVE_OPTION) {
                         fRaso = metodai.atidaroFailaRasymui(fc.getSelectedFile());
                         metodai.rasoFaila(fRaso, sarasas);
                         fRaso.close();
                    } else if (rez == JFileChooser.CANCEL_OPTION) {
                    } else if (rez == JFileChooser.ERROR_OPTION) {
        catch (IOException sit) {
        }Writing methods:
     public void rasoFaila(PrintWriter fRaso, ArrayList sarasas) {
          Iterator iter = sarasas.iterator();
          while(iter.hasNext()) {
              Sarasas s = (Sarasas)iter.next();
               String rasymui = s.gautiPavarde() + "   "
                         + s.gautiDarboPavadinima() + "   "
                         + s.gautiAtlyginima();
               fRaso.println(rasymui);
     public PrintWriter atidaroFailaRasymui(File failoVardas) throws IOException {
          return new PrintWriter(new FileWriter(failoVardas));

Solved

Similar Messages

  • Open Create Replace problems with saving file patterns

    Hello, I got a problem with open/replace/create function. Could you please clarify each function how it works? As you can see in my file, I try to save into the specified file path. The values appear in the text file but when I change some values in the data mainstream, it replaces the old value it has been. I want to have the whole data in one file till I close it and open another file for the operation.
    How can I do it??
    Thank you
    Solved!
    Go to Solution.
    Attachments:
    Values Measurement 1-main.vi ‏34 KB

    Hi,
    I can't see your VI as it is in a newer version of LabVIEW than I have, so if you want any more specific help you'll need to save the VI as a previous version. (File -> Save as previous version) I have LabView 2009.
    However, I have made a quick little example you could use. You don't need to use Set File Position if you use Shift Registers, as shown in the attached picture.
    David.
    Attachments:
    WritetoFile-simple.png ‏21 KB

  • Problem with saving files

    Hello,
    I use FW since 2002,
    I am having an anyoing problem:
    when I save the file, let's say logo.png, I save it in the folder of my client clientxxx
    I want to export the file into jpg, and I try to export and by default the export command opens the desktop and I have to navigate all the way to the folder where the clientxxx files are, why? that didn't use to happen in the past versions, is anoying because everytime I have to save the logo lets say a modification I have to navigate to the correspondent folder.
    THanks

    Which Fireworks version do you use?
    8? CS3? CS4?
    I think that Fw works in this way (some of its logic):
    1) If you have saved client-logo.fw.png in folder D:\MyClients\Client1\, then exported the file as client-logo.jpg in folder D:\MyClients\Client1\ and then saved the .fw.png file again, next time you will open client-logo.fw.png and try to export again, it will automatically go to D:\MyClients\Client1\ -- the PNG file will "remember" where you exported it last!
    2) If you have saved client-logo.fw.png in folder D:\MyClients\Client1\, then exported the file on the desktop, then saved the .fw.png file again, next time you will open client-logo.fw.png and try to export again, it will automatically go to desktop for the exported JPG version! -- the PNG file will "remember" where you exported it last -- like, Desktop!
    3) If you have saved client-logo.fw.png in folder D:\MyClients\Client1\, then exported the file on the desktop, then you DID NOT save the .fw.png file again, next time you will open client-logo.fw.png and try to export again, it will automatically go to the *last* folder you have used to export some Fw PNG file! It could be Desktop, My Documents, or D:\MyClients\Client1\.
    These are the basics... If you think Fw should behave in a better way in this area, please send your idea to Adobe:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Fireworks dev team will surely listen to you!

  • Problems with saving files

    I'm on Mavericks 10.9.01 on a MACPRO. Whnever I save a file on my Philips 273EL I am unable to see the files names in the various folders I want to save, while the folder Icons and names are visible.
    If I open any folder again its content names are totally unreadable
    How to solve this problem if anyone has it?
    I already find very unuser friendly the toolbar without colours as the colors helped before and I do not understand what is good about that change ...
    With the same monitor using a Snow Leopard system this doesn't happen. Hence I suppose is not an hardware problem but something in the Mavericks system I might be able to adjust with so help from this community.
    I hope someone can help
    Regards to all

    I already find very unuser friendly the toolbar without colours as the colors helped before and I do not understand what is good about that change ...
    The only way to add color back is using a program to hack the system. I keep sending feedback about the lack of color.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Problems with saving a file

    Hello,
    Im having problems with saving files on my computer, from Mail and Safari. I have 900gb free diskspace, but i simply cant save anyhow, it says my disk is full.
    Have i accidentally locked something up?
    Regards,
    Niclas

    Run disk utility on your hard drive to repair your permissions.  http://support.apple.com/kb/HT1452

  • Problem with saving a pdf file to computer. Continually get an error message " This document could not be saved. There was a problem reading this document (21).

    Need advice on a saving file issue. I'm having problem with saving a .pdf file to computer. Continually get an error message " This document could not be saved. There was a problem reading this document (21). This is new as this error message just recently started to pop-up.

    More information about this issue can be found here:
    https://forums.adobe.com/thread/1672655
    A "quick" fix that worked for me was to uninstall Adobe... then download the base install for Adobe Reader 11.0.
    Then download each of the individual updates and run them sequentially. 
    I've installed back up to the last security update which is version 08 and have been able to do normal Save As operations.
    You will have to disable automatic updates in order to stay at version 08 until Adobe resolves this issue in a later release.
    http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Windows
    Adobe Reader 11.0 - Multilingual (MUI) installer    AdbeRdr11000_mui_Std
    Adobe Reader 11.0.01 update - Multilingual (MUI) installer    AdbeRdrUpd11001_MUI.msp
    Adobe Reader 11.0.02 update - All languages    AdbeRdrSecUpd11002.msp
    Adobe Reader 11.0.03 update - Multilingual (MUI) installer    AdbeRdrUpd11003_MUI.msp
    Adobe Reader 11.0.04 update - Multilingual (MUI) installer    AdbeRdrUpd11004_MUI.msp
    Adobe Reader 11.0.05 security update - All languages    AdbeRdrSecUpd11005.msp
    Adobe Reader 11.0.06 update - Multilingual (MUI) installer    AdbeRdrUpd11006_MUI.msp
    Adobe Reader 11.0.07 update - Multilingual (MUI) installer    AdbeRdrUpd11007_MUI.msp
    Adobe Reader 11.0.08 security update - All languages    AdbeRdrSecUpd11008.msp

  • Problem with saving pdf files to Mac

    Hi All
    I'm having a problem with pdf files.  When I get sent a pdf fielder email I can open it with no problems but I cannot seem to save it successfully to my Mac. I've tried opening file and doing a 'save as', copy and pasting and dragging and dropping but I keep getting the following message
    Adobe Reader could not open 'filename.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    Any ideas how I sort this out?

    Can you use your email client's Save Attachments feature to save the file?

  • What is the exact problem with this file?

    Hi all,
    There is an old form , which was not in use from many days.
    Now when we tried to run the form, i got the error saying "FRM-40734:Internal Error:Pl/SQL error occured.", in the login form.
    When i tried to open the fmb file in Oracle Forms Builder 6i, i got the following error:
    FRM-10102: Cannot attach PL/SQL library d2kwutil. This library attachment will be lost if the module is saved., but the fmb file got open.
    The login button has the following code:
    DECLARE
      UNAME VARCHAR2(30);
      --USER_ID PARAMLIST;
      V_USER APUSERMA.USER_NAME%TYPE;
      V_PASSWED APUSERMA.USER_PASSWD%TYPE;
    BEGIN
    select user_CD INTO :GLOBAL.USER_ID from apuserma 
    where user_CD = :TI_USER_NAME AND user_PASSWD = :IT_USER_PASSWD
    AND SYSDATE BETWEEN USER_VALID_FRM AND USER_VALID_TO;
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    :global.compname := :compname;
    compnm(:compname);
    --USER_ID := CREATE_PARAMETER_LIST('USER_id_NAME');
    call_form('Forms\MAIN_SCREEN',hide,DO_REPLACE);
    exception
      when no_data_found then
      MESSAGE('Incorrect Username or Password.  Please Re-Enter');
      message(' ');
      RAISE FORM_TRIGGER_FAILURE;
    END;
    EXIT_FORM;
    When i tried to compile, i got error saying ,
    Error 201 at line 10, column 28
    identifier 'WIN_API_ENVIRONMENT.READ_REGISTRY' must be declared.
    I am not getting to know What is the exact problem with this file?
    Help me with this please.
    Thank You.
    Oracle forms builder 6i.
    Oracle 9i.

    Vijetha wrote:
    I also want to know what is the use of  win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername') ??
    What does it do??
    If i comment the following line , will it be a problem??
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    Because i commented the above line & compiled, so it is not giving any error now.
    So please tell me what win_api_environment.read_registry does??
    it's read windows registry value. So, no problem if you comment it.
    Thanks

  • Problem with NEF files from Nikon D4

    Hi everyone. I find a problem with nef files from my Nikon D4. When files are open in ViewNX2 (free viewer software from Nikon) they are perfect, as shooted... but in ACR they are very different... I use LR4 or CS5 with ACR 6.7 and the difference seems to be linked at D-Lighting function. My impression is that ACR dont read this option and picture are very very dark that original shootings. Anyone have this problem?

    This question used to be answered in the FAQ before they revised it.  So, here we go again.  ViewNX is capable of reading all of the in-camera settings such as, camera profile, saturation, sharpness and other settings.  It is capable of doing this because it is Nikon Software, and they have the ability to program it to read the settings from their raw images.  Lightroom does not read those settings from Nikon cameras or any other brand of camera.  Part of the reason is that different camera makers store those settings differently.
    When I first started using Lightroom I adjusted one of my images that represented what I normally shoot until it looked the way I wanted it.  Then I saved those adjustments as my default settings for the camera.  From that point onward, whenever I import images those settings are automatically applied, and it takes care of the vast majority of my images.  Of course, I still have to make individual adjustments.  But my default settings greatly reduce the amount of how they work that I have to do.
    Active D-lighting is is one of those features that Lightroom does not recognize.  You would be well advised not to use it, or else create a preset to simulate its effect.  It will provide no benefit to your Lightroom work.
    This is a fundamental difference with Lightroom, and something that must be understood and implemented if you are going to use the program effectively.
    I realize this question was asked in the ACR forum and I referenced Lightroom throughout.  But the principle is the same, and the recommended procedure is the same.

  • Problems with .ARW files and auto toning

    problems with .ARW files and auto toning
    let me try to explain this because this has happened in past and never found a way to resolve but i lived with it
    now that I have a Sony A7R the problem is more serious
    Firstly i take pride it making the picture happen all in camera, i use DRO lvl 5 to get enough light, like when i'm shooting at dusk. DRO its like doing HDR but in a single file, it lightens the darks. in my camera i'm happy with results
    but when I upload them to lightroom, they come out near black.
    allow me to explain
    lets say I import 100 images
    i double check my preferences and everything is UNCHECKED when it comes to importing options, there is no auto toning, nothing.
    as the images import i see a preview in the thumbnail which looks fine.
    i double click on one to enlarge it, hence leave grid view.
    for a brief 1 or 2 seconds, i see the full image in all its glory but than lightroom does something funny, it darkens the image
    one by one as it inspects each image, if it was a DRO image it makes it too dark.
    to make this clear, the image is perfect as it was in the beginning but after a few seconds lightroom for some reason thinks it needs to correct it.
    how to prevent lightroom from doing this, i want the image exactly as it is, why must lightroom apply a correction>?
    i think it has to do something with interpreting the raw file and lightroom applies its own algorithm.
    but here is what i dont get.....before lightroom makes the change i'm able to witness the picture exactly as it was taken and want it unchanged..
    now i have to tweak each file or find a profile for it which is added work.
    any ideas how to prevent lightroom from ruining my images and just leave them as they were when first detected...
    there are 2 phases...one is when it originally imports and they look fine
    second is scanning each image and applying some kind of toning which darkens it too much.
    thanks for the help

    sorry thats the auto reply message from yahoo email.
    i've disabled it now
    thing is, there is no DRO jpg to download from the camera
    its only ARW. so my understanding is when i use DRO setting, the camera makes changes to the ARW than lightroom somehow reads this from the ARW.
    but then sadly reverts it to no DRO settings.
    because i notice if i take normal picture in raw mode its dark but if i apply dro to it, it comes out brighter, yet when i d/l the image from camera to lightroom, which is an ARW - there are no jpgs. lightroom decides to mess it up
    so in reality there is no point in using DRO because when i upload it lightroom removes it.
    is there a way to tell lightroom to preserve the jpg preview as it first sees it.
    its just lame, picture appears perfect...than lightroom does something, than bam, its ruined,.
    what do i need to do to prevent lightroom from ruining the image? if it was good in the first place.

  • Problems with compressing  files with right hand click. it does not work.

    Problems with compressing files with right hand click.
    I am using the compress function in the Mac OS (File > Compress XX) from time to time. Today it does not work anymore. OS 10.5.6
    I get a message: The content list cannot be created for compressing.
    I tried it with files and folders and keep getting this message. Anybody any idea as to how to fix this

    Thanks I love my macbook!!!!
    I also got further problems such as copy-paste not working etc.
    so I fixed it just this morning by running Applejack 1.5 and am back up running noticing your post.
    thanks for helping though!

  • Problem with Image file

    Hi,
    Iam facing with one problem.I have one swing interface through which I can upload files(back end servlet programme).Now I can upload all types of file but problem with image file it uploading perfectly that means size of the uploaded file is ok but its format damaged.It can not be open.My backend servlet programme is ok coz i tested it with html form it is working perfectly.Problem with swing interface.Plz guide me where I done a mistake.Below r my codes:-
    ImageIcon Upload=new ImageIcon("images/Upload.gif");
         Button=new JButton(Upload);
         Button.setToolTipText("Upload");
    Button.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
              int returnVal = fc.showOpenDialog(ActionDemo4.this);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              File file = fc.getSelectedFile();
    String aa=file.getAbsolutePath();
              textArea3.append(aa);
                   textArea2.append("Local URL:");
    long l=file.length();
              try
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff);
              String str1=textArea10.getText();
    url = new URL ("http://127.0.0.1:7001/servletUpload?x="+str1);
         urlConn = url.openConnection();
         urlConn.setDoInput (true);
         urlConn.setDoOutput (true);
         urlConn.setUseCaches (false);
         urlConn.setRequestProperty("Content-Type","multipart/form-data;boundry=-----------------------------7d11e410e500f2");
         printout = new DataOutputStream (urlConn.getOutputStream ());
    String content ="-----------------------------7d11e410e500f2\r\n"+"Content-Disposition: form-data;"+"name=\"upload\"; filename=\""+aa+"\"\r\n"+"Content-Type: application/octet-strem\r\n\r\n\r\n"+conffile+"-----------------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);
    printout.flush ();
    printout.close ();
    Best Regards
    Bikash

    The errors are here:
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff); (conffile is a String object containing the image)
    and here:
    String content ="-----------------------------7d11e410e500f2\r\n"+"Con
    ent-Disposition: form-data;"+"name=\"upload\";
    filename=\""+aa+"\"\r\n"+"Content-Type:
    application/octet-strem\r\n\r\n\r\n"+conffile+"--------
    --------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);conffie is sent to the server but
    it's non possible to treat binary data as String!
    Image files must be sent as byte[] NOT as String ......

  • Problem with Receiver File adapter

    Hi
    I have a problem with receiver file FTP adapter, while writting file in target folder, connection is failing, after retries, it writting file again. How to avoid this situation, is there any way to write the leftout part in the file.
    VS

    Hi
    Thank u all,  Problem is solved, i changed write mode to Over write existing file. It is working fine.
    VS

  • Has anyone had a problem with TapMedia File Manage on iPhone 5. I reported a WIFI functionality problem to the developer and asked for support. Instead they have been very unprofessional by name calling me instead of logically evaluate and troubleshoot th

    Has anyone had a problem with TapMedia File Manage installed on iPhone 5? I reported a WIFI functionality problem to the developer and asked for support. Instead the company has been very unprofessional by name calling me instead of logically evaluate and troubleshoot the problem

    Hi AKE1919,
    Welcome to the Support Communities!
    The following information should help you with this:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933?viewlocale=en_US
    Cheers,
    Judy

  • Problem with import file type setting

    Problem with import file type settings - In preferences>general I select "wav encoder" But then going to tools>Create it still says "create mp3 version".
    Can't find a way to overcome this. Thanks for any help.

    Doublechecking, roy. After making the preferences change, are you leaving the General tab by clicking the OK button down the bottom-right-hand corner of the tab?

Maybe you are looking for

  • How to change user status in maintenence order

    Hi all, I want to change system status in maintenence order by customizing kindly share how we can change it.

  • Photoshop CS3 Codec error

    When I import the Beta Photoshop CS3 files into FCP 5.12 on a PPC Dual or Quad G5, I get the Codec Error, "Codec not found. you may be using a compression type without the corresponding hardware card." Is there something I am missing with the beta CS

  • Cant´t find universal adapter and/or maps into Informatica

    Cant´t find universal adapter and/or maps into Informatica for data model industry for financial module. First we verify 101 files for Universal Adapters, next search into informatica SDE_Universal_Adapter folder to find this files but the half of fi

  • Cant Connect with facetime

    me and my friend wanted to have a facetime chat together so i called him, he answered and on his side it said connecting... but on my side it said facetime... we waited for a few minutes and lost connection. He then tried to call me and i didn't even

  • How to config Touchpad Toshiba Satellite Pro C640 (PSC2VL)

    This is file /var/log/Xorg.0.log (full here: http://pastebin.com/VJucuxa2): [ 13.225] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event7) [ 13.225] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad