Why ehen appending text file to text area, all the text in 1 line..

please hlp
      public void actionPerformed(ActionEvent e)
          TArea.setText("");
          try
          String StrNeeded;
          BufferedReader BR;
          BR=new BufferedReader(new InputStreamReader(new FileInputStream("Data.txt")));
          StrNeeded=BR.readLine();
               while(StrNeeded!=null)
               TArea.append(StrNeeded);
               StrNeeded=BR.readLine();
          catch(Exception excep)
}this is my code m problem is that,
i read a text file that has many lines, when i read it, i append it into the textarea, but what happend was all the text in my text area is in 1 line only(the other line is also appended but it is appended in the sama line.. help me

readLine removed the line feed from the end of the line.
You should append a \n to the end of the line like this:TArea.append(StrNeeded + "\n");Also it's a bad idea to catch an exception and do nothing.
Add printStackTrace in the catch block.

Similar Messages

  • Adobe reader shows text but won't print all the text

    I have a form used by many and it works with no problem.  Today one came in you could see all the text, but when printed, only some of the text appeared.
    I checked it on 3 machines, also one that has Acrobat 9  on it, same results.
    On the print setup, under comments and forms, I  have Documents and Markup set,  but if I click on "form field only"  I do get the missing text.
    As said we have gotten many forms from other people, no problems, so it really not for lack of knowing how to print it correctly.
    The only print preview I can see I have is when I go to print it, it appears on the right, and it is missing the text there.
    I have removed all name and address from the form for privacy reason,   I did add my name in a few blocks and then saved it but it won't print that also.
    for some reason only the top row under CPR   AED  and SFA print, but as you can see, there are a bunch that don't, along with all the names I removed.
    Thanks in advance.
    John
    Any ideas?
    Tuesday--still working on this,  I activited the voice part of my acrobat 9 and it reads all the text while in PDF form, just won't print it.
    John

    Restarted computer and seems to be working again.

  • WebLogic writes to a text file and an applet reads the text file

    Hi there,
    I need some help here!
    I have an applet that needs to read from a text file:
    final URL prtDataURL = new URL("http://" + getCodeBase().getHost() + ":" + getCodeBase().getPort() + "/ESTC/lib/prtDataFile.txt");
                final URLConnection urlConn = prtDataURL.openConnection();
                urlConn.setUseCaches(false);
                urlConn.setDoInput(true);
                urlConn.setDoOutput(false);
                final InputStreamReader is = new InputStreamReader(urlConn.getInputStream());
                final BufferedReader in = new BufferedReader(is);
                String inputLine;
                while ((inputLine = in.readLine()) != null){
                    String[] tmp = inputLine.split("§");
                    this.dateTime = tmp[0];
                    this.quanTot = Integer.parseInt(tmp[1]);
                    this.quanSco = Integer.parseInt(tmp[2]);
                    this.quanSef = Integer.parseInt(tmp[3]);
                    this.valTot = Double.parseDouble(tmp[4]);
                    this.valSco = Double.parseDouble(tmp[5]);
                    this.valSef = Double.parseDouble(tmp[6]);
                in.close();
                is.close();and this is ok.
    Now I have the web server (WebLogic) that must write, at regular time intervals, to that file (prtDataFile.txt). The web application writes to the file (which belongs to the application).
    I've tried open the file with the File object but since the war file is unexploded I can't get the real path!
    I've tried open an url connection,
    final URL url = new URL("http://10.191.33.249:16801/ESTC/lib/prtDataFile.txt");
    final URLConnection connection = url.openConnection();
    connection.setDoOutput(true);
    connection.setUseCaches(false);
    connection.setDoInput(false);
    OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
    out.write(currentDate + "§" + quantTot + "§" + quantSco + "§" + quantSef + "§" + valTot + "§" + valSco + "§" + valSef);;
    out.flush();
    out.close();which seems a little stupid since I'm opening an URLConnection to the same place where the application is. Anyway it doesn't work, i.e., it doesn't write to the file but it doesn't gives me any errors or exceptions.
    Is there another way to get this two pieces communicating?
    Thanks in advance

    I have almost the exact same problem, and I am in the same situation as you are with respects to the language.
    I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
    My method:
    debug = new Label() ;
    debug.setLocation( 20, 20 ) ;
    debug.setSize( 500, 15 ) ;
    add( debug ) ;
    // output
    try
         OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
         byte[] buffer = { 1, 2, 3, 4, 5 } ;
         file.write( buffer ) ;
         file.close() ;
    } catch( Exception e )
         debug.setText( e.toString() ) ;
         Can anyone tell why this isnt working?

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • Writing Records in a Text File to Specific Columns in the Text File

    Help Please! I am a noooooooooobbbbbb!
    I have searched this forum looking for a procedure that will write records from my database into certain col (positions) in a text file. Example:
    1234 TONY TEST 84889922 Y 34 TORCHCOMP 34
    5678 BOB JOHNS 43534534 N 56 SAFDWEERE 65
    I am thinking I would like to setup variaables like:
    Consumer_ID = Consumer(position 1,5)
    Name = name(position 10,20)
    Invoice_No = Invoice(position 30,40)
    etc.
    Any input will be greatly appreciated
    Thank You

    Hi,
    That's a formatting issue.
    Formatting is best done in the front end. For example, using SQL*Plus:
    COLUMN     consumer_id     FORMAT 9999     HEADING     c_id
    COLUMN     filler_6_9     FORMAT A4     HEADING     " "
    COLUMN     name          FORMAT A11
    COLUMN     filler_21_29     FORMAT A9     HEADING     " "
    COLUMN     invoice_no     FORMAT 9999999999
    SET     COLSEP          ""
    SET     PAGESIZE     9999
    SPOOL     x.dat
    SELECT     consumer_id
    ,     ' '          AS filler_6_9
    ,     name
    ,     ' '          AS filler_21_29
    ,     invoice_no
    FROM     table_x;
    SPOOL     OFFIf you have to do it in the back end, use functions like TO_CHAR and RPAD to make each part exactly the right length, then concatenate them all into one big string:
    SET     PAGESIZE     0
    SPOOL     x.dat
    SELECT     TO_CHAR ( consumer_id
              , 'fm99999'
              )          -- 1-5
    ||     '    '               -- 6-9
    ||     RPAD ( name
              , 11
              )               -- 10-20
    ||     '         '          -- 21-29
    ||     TO_CHAR ( invoice_no
              , 'fm9999999999'
              )          -- 30-40
    FROM     table_x;
    SPOOL     OFFEdited by: Frank Kulash on May 22, 2009 10:40 AM

  • Reading data from a text file but can't use the data outside of the function.

    I am trying to load a variable from data in a text file.
    I can read the text file fine but the variable data seems
    only to be available with in the function that reads it.
    I need to use the variable data outside of the function.
    Does anyone have any suggestions to work around this issue?
    This is the actionscript code i'm using.
    var pathVars= new LoadVars();
    pathVars.onLoad=function(ok) {
    if(ok)
    trace("Loading");
    path_var=pathVars.path;
    trace("This is within the function "+path_var);
    pathVar0="This is within the function... "+path_var;
    Yet the path_var is available here fine.
    pathVars.load("mypath.txt");
    This is where the path_var becomes undefined
    trace("This is outside the function... "+path_var);
    pathVar1="This is outside the function... "+path_var;
    This
    is a download link for the FLA zip file
    This
    is a demo of the script loading the text file

    The external traces are being executed before the file is
    loaded.

  • I've created a Photoshop PDF and all the text is editbale after passing through indesign to add crop marks and bleeds - one line now isn't editable, what's causing this

    I've created a Photoshop PDF and all the text is editable in the resulting PDF.
    The PDF created by Photoshop is completely editable, all text! I put it through indesign so I could add crop marks and reduce the pdf file size and now all the text is editable except one line!
    I've not used any faux styles or effects...what could be causing this?
    Thanks!

    I've created a Photoshop PDF and all the text is editable in the resulting PDF.
    The PDF created by Photoshop is completely editable, all text! I put it through indesign so I could add crop marks and reduce the pdf file size and now all the text is editable except one line!
    I've not used any faux styles or effects...what could be causing this?
    Thanks!

  • Please help! I defragged my hard drive and now Illustrator CS6 is trying to open all of my complex Illustrator files with a "Text Import Options" box as if they are text files, and they are not opening!

    Please help! Illustrator CS6 started trying to open all of my complex.ai files with a "Text Import Options" box as if they were text files, and they are not opening!  Help!

    Hi Monika,
    I have spent the last two or three days trying to do what you suggested.  I uninstalled Adobe 6 from Windows.  Some files that CS6 placed on my system during installation remained, including fonts and .dll files.
    I had to abandon the Cleaner Tool you suggested because in one screen it allowed me to specify removing CS6 only, but on the following screen it only gave on option to remove ALL Adobe programs.  I could not do that because I didn't have the serial number handy for CS3 in case I want to reinstall it at some point.
    I tried to get technical help with the Cleaner Tool problem but no definitive help was available, so I reinstalled CS6 again without having the benefit of the Cleaner Tool.  I tried to get the serial number for CS3 so I could use the Cleaner Tool but spent 2 wasted hours in chat.  Even though I had a customer number, order number, order date, place of purchase, the email address used AND 16 digits of the serial number, in two hours the agent couldn't give me the serial number.  After two hours I had nothing but instructions to wait another 20 minutes for a case number.
    Illustrator CS6 is still trying to open some backups as Text and otherNone of the problems have been fixed.  I have tried to open/use the .ai files in CS6 installed on another system and am getting the same result, so I don't think the software was damaged by the cleaner.  The hard drive cleaner is well-known and I've run it many times without any problem to previous versions of Illustrator or any other programs.
    When I ordered, the sale rep promised good technical support and gave me an 800 number, but after I paid the $2000, I learned that the 800 number she gave me doesn't support CS6 and hangs up on me.  Adobe doesn't call it a current product even though they just sold it to me about 3 weeks ago.
    Would appreciate any help you experts can offer.  If I can't solve this, the last backup I can use was from June and I will have lost HUNDREDS of hours of work and assets that I cannot replace.
    Exhausted and still desperately in need of help...

  • What are all the reasons why imessages turn into text messages...such as the recipient is talking on the phone, etc.?

    what are all the reasons why imessages turn into text messages...such as the recipient is talking on the phone, etc.?

    Hi,
    What's the worst that I've spent 100 Eur alltogether for GPS map based applications for several sports - golf, bike, ski, etc. These applications use data from iPhone Map application and its disaster after my update onto iOS 6. These are pictures of 2 of my favorit golf resorts:
    And here one example from a place where I use to bike:
    Very nice, isn't it?
    And unfortunately this problem won't disappear even when Google put stand alone map application into iStore.
    So I have only way to downgrade to 5.1.1 immediately to not throw away money I already spent.
    Ivan

  • I was given an assingment, but have no idea where to begin. The assingment is to create a text file using notepad with all of my digital inputs and some how make those imputs show up on my digital indicators on my control pannel

    I was given an assingment, but have no idea where to begin. The assingment is to create a text file using notepad with all of my digital inputs and some how make those imputs show up on my digital indicators on my control pannel.
    When it was explained to me it didn't sound to hard of a task, I have no LabVIEW experience and the tutortial sucks.

    StevenD: FYI, I did NOT give you the one star rating. I would never do that!
    StevenD wrote:
    Ow. Someone is grumpy today.
    Well, this is an assignment, so it is probably homework.
    Why else would anyone give HIM such an assigment, after all he has no LabVIEW experience and the tutorials are too hard for him?
    This would make no sense unless all of it was just covered in class!
    This is not a free homework service with instant gratification.
    OK! Let's do it step by step. I assume you already have a VI with the digital indicators.
    "...but have no idea where to begin".
    open notepad.
    decide on a format, possibly one line per indicator.
    type the document.
    close notepad.
    open LabVIEW.
    Open the existing VI with all the indicators.
    (are you still following?)
    look at the diagram.
    Who made the program?
    Does the code make sense so far?
    Is it a statemachine or just a bunch of crisscrossed wires?
    Where do you want to add the file read?
    How should the file be read (after pressing a read button, at the start of the program ,etc.)
    See how far you get!
    Message Edited by altenbach on 06-24-2008 11:23 AM
    LabVIEW Champion . Do more with less code and in less time .

  • Hi i am new to labview. i want to extract data from a text file and display it on the front panel. how do i proceed??

    Hi i am new to labview
    I want to extract data from a text file and display it on the front panel.
    How do i proceed??
    I have attached a file for your brief idea...
    Attachments:
    extract.jpg ‏3797 KB

    RoopeshV wrote:
    Hi,
    The below code shows how to read from txt file and display in the perticular fields.
    Why have you used waveform?
    Regards,
    Roopesh
    There are so many things wrong with this VI, I'm not even sure where to start.
    Hard-coding paths that point to your user folder on the block diagram. What if somebody else tries to run it? They'll get an error. What if somebody tries to run this on Windows 7? They'll get an error. What if somebody tries to run this on a Mac or Linux? They'll get an error.
    Not using Read From Spreadsheet File.
    Use of local variables to populate an array.
    Cannot insert values into an empty array.
    What if there's a line missing from the text file? Now your data will not line up. Your case structure does handle this.
    Also, how does this answer the poster's question?

  • I am converting a .docx file to a pdf and the text is coming out blurry

    I am trying to convert a .docx file to a pdf and the text keeps coming out blurry. Some sentences seem to be bolded in the pdf as well. All the colored text seems like there's a shadow behind it and all the text in bold seems extra blurry. I am saving the file as a pdf. I tried to print the file as a pdf but it kept crashing. I have adobe acrobat pro and distiller, but I'm not savy about which program does what.
    Thanks for any help!

    If you are trying to convert a Word file, ensure the text is in 100% black only.
    To create PDF's there are hundreds of different combinations that can be used, but only a few will give you a good 'print ready' file, which is what I think you may be after.
    You may have font issues that are stopping the text looking sharp.
    If you have Distiller, you can try to print as .ps (save as postscript), load distiller up and choose one of the high quality settings in the pop down menu.
    If you are working on a Mac you can drag and drop the .ps file direcetly on the dock icon for distiller, or if you are running Windows you will need to navigate to the file via the menu bar (you will need to know where you have saved your .ps file).
    There may be other issues with the original file format that is causing problems with your PDF creation.
    Let me know how you get on.
    Cheers

  • Why is all the text in the iPod section of my iTunes in grey?

    I just started trying to hook up my iPod to my own windows, as opposed to my mom's mac, which is where it was previously hooked up. I already had iTunes on my comp, and it loaded the songs onto my iPod after all of the other stuff had been taken off. But, all the text is in grey in the section of iTunes where you can fiddle with songs on your actual iPod, as opposed to the ones that are just on iTunes. I can't do anything with the music files on the iPod, but the rest of my iTunes seems fine. What do I do?

    you've currently got one of the automatic updating/syncing options engaged in your itunes ipod preference tab. to directly adjust things in that ipod screen, you would need to have "manually manage songs and playlists" engaged.
    for more info on the various different options, see:
    hudgie: iPod syncing options, OR, My iPod is locked in iTunes!

  • I have a psd file with many layers and text. I want to edit the text. How do I do that?

    Hi all!
    I recently purchased a book cover from a creative....she charged me one amount for the jpeg file and another amount for the psd file and then there's another cost to edit the text on the back cover. Instead of paying all these fees separately I'm trying to edit the text on my back cover myself.
    The problem is I HAVE NO CLUE how to do this....anybody have any help to offer?

    In the psd file, on the right side you should see a panel that says Layers. Expand that panel if it is not already by clicking on it.
    Scroll down through the list in the layers panel until you find the text (there should be a large T for a thumbnail to show it is text)
    Double click on that large T to edit the text. (The text should now be highlighted and the Text tool on the left side of the screen should be selected)
    Type away then select any other layer to deselect the text
    If you do not see any large T capture your screen with the layers panel open, so we can see what layers are there.

  • How to Copy all the text blocks of a converted Word file (Converted PDF TO WORD)

    We have scanned a English book quite a some time ago. Now we have converted it to a Word Document.
    We try to copy the whole text and re-format it and save it as Word/PDF
    The problem is we cannot copy the whole document since it has the text as various blocks.
    It is very hard to select each box and put in a word document or in a notepad.
    Could you please tell me how to select the whole document or whole blocks with single stretch or any easy way to do it?

    "Scanned" -- That tells the story.
    The output of all scanners is an image, a picture if you will, of the paper source.
    Pictures of text are not the "text" itself and thus there is no "text" to copy (let alone paste).
    For PDF files that hold the picture of text that is the output of a scanner you would want to open the PDF with Acrobat.
    Now use Acrobat's OCR capability.
    Suggestion: Use Acrobat's ClearScan. This is "friendlier" to doing touchups to characters / words.
    Export this to Word (Use Acrobat Pro or one of Adobe's online subscription services - ExportPDF or PDF Pack).
    DO expect to do cleanup in the Word file.
    Whenever the source is a scanner's output picture you have a pig's ear & you cannot make a silk purse from that.
    Be well...

Maybe you are looking for