In Files, How to read and write spaces,tabs and newlines

Love..........
After having read a file into a string, when
I use this string in TextArea's setText()      
method. Text Area do not care for spaces,tabs,
newlines. if I print same string using println()
out put has lines,spaces and tabs
----why-------
Similarly when I write to a file getting text
from Aextarea,out put file also produce same
result .

First, if you would like to create a text area that wraps the text, instead of just running on and on, you need to specify, when creating the text area, that you do not want a horizontal scroll bar. For instance:
textArea = new TextArea("", 30, 60, TextArea.SCROLLBARS_VERTICAL_ONLY);
Why does println() cause a newline? Because println means print line... as in, it will print the text, then give a carriage return and line feed value, causing a new line to be created.

Similar Messages

  • How to read and write a string into a txt.file

    Hi, I am now using BEA Workshop for Weblogic Platform version10. I am using J2EE is my programming language. The problem I encounter is as the above title; how to read and write a string into a txt.file with a specific root directory? Do you have any sample codes to reference?
    I hope someone can answer my question as soon as possible
    Thank you very much.

    Accessing the file system directly from a web app is a bad idea for several reasons. See http://weblogs.java.net/blog/simongbrown/archive/2003/10/file_access_in.html for a great discussion of the topic.
    On Weblogic there seems to be two ways to access files. First, use a File T3 connector from the console. Second, use java.net.URL with the file: protocol. The T3File object has been deprecated and suggests:
    Deprecated in WebLogic Server 6.1. Use java.net.URL.openConnection() instead.
    Edited by: m0smith on Mar 12, 2008 5:18 PM

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • How to read and write to file on server

    can any body tell how to read or write to a file on server, like where do i keep the file and what does the path look like......on server
    stand alone i am reading and writing into file but when it comes to server i am confused how it works...i mean the path
    thank you

    The Path needs to be absolute:
    For example in Unix it would look like:
    /usr/paz/Test.txtIn Windows it would look like:
    C:/Paz/Test.txtHope this helps.
    Thanks and regards,
    Pazhanikanthan. P

  • How to read and write on ntfs partitions??

    Hello everyone, thanks for viewing my post.  I want to know how to read and write on ntfs partitions under sata hd on my arch64 system.  I'm using kde as my de and dolphin does sees it but can't access it anyway.  I didn't had problem so far on mounting usb drives it just automounts maybe because it is a fat partition not a ntfs?  Please I need your help...Thanks in advance:)

    You will most likely need to rework your fstab.  The one from my desktop is shown below. If you want regular users to be able to access the partition, then you will need to change the gid option as I have done. Although you could create a group just for people you want to have access.
    You will need to know the device that your windows partition is held on of course. In my case it is my first hard disk, first partition, hence /dev/sda1.
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    none /dev/pts devpts defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0
    /dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
    /dev/mapper/nvidia_fbgfhehd1 /boot ext2 defaults 0 1
    /dev/mapper/nvidia_fbgfhehd2 / reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd3 /var reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd5 /opt reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd6 swap swap defaults 0 0
    /dev/mapper/nvidia_fbgfhehd7 /home reiserfs defaults 0 1
    /dev/sdd1 /mnt/andromeda vfat defaults 0 0
    /dev/sda1 /mnt/windows ntfs-3g defaults,user,gid=users 0 0
    My XP partition is set to mount automatically, as I regularly interchange documents between the OS's.
    Hope that helps.

  • How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    CVI Comes with a sample project that explains how to read/write to a Excel file: choose "Explore examples..." in CVI welcome page and navigate to <cviSampleDir>\activex\excel folder where you can load excel2000dem.prj.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • How to read and upload microsoft word file into database using forms9i

    Hi,
    How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
    Thanks in advance
    Mahesh Ragineni

    The webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
    Regards
    Grant Ronald
    Forms Product Management

  • How to read and XSD file in java prospective in NWDS

    Hi !!
    anybody can help me that
    how to read and XSD file in java prospective in Netweaver developer Studio
    Regards
    Abhishek Agrahari

    I guess you can make it more clear...

  • I want to write record type variable in ult file.How to i can write record type varable without column name.

    I want to write record type variable in ult file.How to i can write record type varable without column name.
    type rec_format_type is record
         format1  VARCHAR(3),
         format2  VARCHAR(3),
    my_record     rec_format_type;
    UTL_FILE.PUT_LINE(file_out, my_record);

    ibney wrote:
    I have below requirement.
    DECLARE
         emp_data UTL_FILE.FILE_TYPE;
    BEGIN
        emp_data := UTL_FILE.FOPEN ('EXDATAPUMP','TEST_BC_NN_PARALLEL.csv','W',32000);
        FOR TEST1 IN (SELECT /*+ PARALLEL(TEST_BC_NN,4) */  * FROM TEST_BC_NN) LOOP
            UTL_FILE.PUT_LINE (emp_data, TEST1);---Here i want to write record in utl file.without knowing the structure of table
        END LOOP;
        UTL_FILE.FCLOSE (emp_data);
    END;
    Why all the ugly upper case? You do realise that NO programming standard, ranging from Java and .Net, to C/C++ and Ada (of which PL/SQL is an implementation of), use upper-case-for-reserved-words as a standard.
    The easiest and simplest way to address your requirement is as follows:
    SQL> create or replace type TStringArray is table of varchar2(4000);
      2  /
    Type created.
    SQL>
    SQL>
    SQL> begin
      2          for c in(
      3                  select
      4                          TStringArray(
      5                                  to_char(empno,'000000'),
      6                                  ename,
      7                                  to_char(hiredate,'yyyy-mm-dd')
      8                          ) as COLS
      9                  from    emp
    10                  order by empno
    11          ) loop
    12                  for i in 1..c.Cols.Count loop
    13                          dbms_output.put( c.Cols(i) );   -- write column
    14                          if i < c.Cols.Count then
    15                                  dbms_output.put( '|' ); -- write column separator
    16                          end if;
    17                  end loop;
    18                  dbms_output.put_line( ' *end*' );               -- write record terminator
    19          end loop;
    20  end;
    21  /
    007369|SMITH|1980-12-17 *end*
    007499|ALLEN|1981-02-20 *end*
    007521|WARD|1981-02-22 *end*
    007566|JONES|1981-04-02 *end*
    007654|MARTIN|1981-09-28 *end*
    007698|BLAKE|1981-05-01 *end*
    007782|CLARK|1981-06-09 *end*
    007788|SCOTT|1987-04-19 *end*
    007839|KING|1981-11-17 *end*
    007844|TURNER|1981-09-08 *end*
    007876|ADAMS|1987-05-23 *end*
    007900|JAMES|1981-12-03 *end*
    007902|FORD|1981-12-03 *end*
    007934|MILLER|1982-01-23 *end*
    PL/SQL procedure successfully completed.
    SQL>

  • File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled.

    I have duplicated a project to work on another computer. The project opens fine but when I import new footage/audio files I get this message. "File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled." Then I can't play my timeline and Premier Pro crashes.  I have to force quit and restart my computer to continue working. What does this error really mean? How do you rectify?
    Our workflow requires that we duplicate projects to make updates because we are frequently revising but need to keep original project unchanged and intact.

    I have a similar issue and message , but occurs when I import AVI clips from OnLocation CS4 to Premier Pro CS4.

  • How to read and then extract HTMl source code using java program?

    Hi,
    Could someone tell me how to read and then extract the content of certain tag from html source code. For example, given url http://.... , I would like to know what the <Title> content <Title> in that page is.
    Any help is greatly appreciate.

    Use a URLConnection to make the connection to the page at the needed URL. From the URLConnection, you can get an InputStream that is the stream of data from that page. Just search through the stream and find the <title> tags (don't forget to check for case sensitivity).

  • How to read and write data from json file from windows phone7 app

    Hi
    I am developing wp7 app for the use of students my questions are
    How can i write a code to read and write the json/text file for the wp7.
    I am using windows 7 OS, VS 2010 Edition.
    This is my code below:
    xaml:
    <Grid>
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="7,18,0,550" Name="textBlock1" Text="Full
    Name: " />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,1,0,0" Name="txtName"
    Text="Enter your full name" VerticalAlignment="Top" />
                        <TextBlock Height="45" HorizontalAlignment="Left" Margin="6,75,0,0" Name="textBlock2" Text="Contact
    No: " VerticalAlignment="Top" />
                        <TextBox Width="350" Height="70" HorizontalAlignment="Left" Margin="108,61,0,480" Name="txtContact"
    Text="Enter your contact number" MaxLength="10" />
                        <Button Content="Register" Height="72" HorizontalAlignment="Left" Margin="10,330,0,0" Name="btnRegister"
    VerticalAlignment="Top" Width="190" Click="btnRegister_Click" />
                    </Grid>
    xaml.cs:
    private void btnRegister_Click(object sender, RoutedEventArgs e)
                string name, contact;
                name = txtName.Text;
                contact = txtContact.Text;
                try
                    if (name != "" && contact != "")
                        string msg = name + " " + contact;
                        MessageBox.Show(msg);
                        Student stud = new Student
                            Name= name,
                            Contact = contact,
                        string jsonString = JsonConvert.SerializeObject(stud);
                        MessageBox.Show(jsonString);
                    else
                        MessageBox.Show("Input Proper Information", MessageBoxButton.OK);
                catch (Exception ex)
                    MessageBox.Show(ex.Message);
    I have download NewtonSoft.json version 5.0.8.
    So, I am able to convert input data into json format, but how can I able to write and read this data from a json/text file.
    How can I do?
    Thank you in adv and please, reply soon.

    We don't have many samples left for Windows Phone 7 + Azure, the closest one to what you want to do is probably:
    Using Local Storage with OData on Windows Phone To Reduce Network Bandwidth
    this sample uses the local database feature: 'LINQ to SQL', available to Windows Phone 7.1 and 8.0 Silverlight applications, instead of simple file storage but even if you choose to stick with simple file storage I believe you should be able to adapt the
    networking related portions of the sample to your particular application.
    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast
    your votes for existing suggestions.

  • How to read and write(a file .txt) from a URLConnection

    I try to read and write on one URLConnection. Is it possible ? How can i make it ?
    The reading part of my application work's but not the writting part
    That's a part of rhe code that i use to write :
    String Line = "Hi";
    MyUrl = new URL(this.getCodeBase(), FichierEvenement) ;
    Con = MyUrl.openConnection() ;
    Con.setDoOutput(true);
    Con.setDoInput(true);
    Con.setUseCaches(false);
    Dos = new DataOutputStream(new BufferedOutputStream(Con.getOutputStream( )));
    Dos.writeUTF(Line);
    Please help me :)

    What are you doing with the bytes written to the OutputStream? This info would help, but i do have a suggestion. I ran into this problem when trying to write strings using writeUTF. The output was all screwed up. So, maybe change your string to a character array. That way Unicode is displayed properly. This in conjunction with writing to an .html file instead of to the connection itself might work.

Maybe you are looking for

  • Low disk space error

    When trying to navigate in large Word files--about 50 pages long, with many photo files within, I get an error message that I do not have enough disk space to save the file, or to continue working in the fil. My MacBook has 109.17 GB available on the

  • Short Dump with Fetch in ECC 6.0

    Hello Friends, I have a query sth like this. <b>fetch next cursor wc_cursor          into table it_bdi_entry          package size s_pkg.</b> it_bdi_entry is a internal table of type bdi_entry. When i use this fetch statement in ECC 6.0 and the fetch

  • Account is blocked messege is display:

    Good Day everybody, Please help me out, I have few issues that, 1) I am seafarer and sailing from one place to another. We have internet on ship in which skype is the medium for connecting to our home. Skype was working good till 21 June, 2014. I had

  • I reset my appleID but can't purchase ebook

    I reset my appleID but can't purchase ebook

  • Apps in SD lost when USB memory is connected

    D6633. Lollipop, 128gb SD, when I connect 32gb to USB port, all apps moved to SD memory is "lost". Ejecting USB does not help. Only after reboot does apps in SD work again.