Results 1 to 5 of 5

Thread: File Output

  1. #1

    Thread Starter
    Lively Member Crazy_bee's Avatar
    Join Date
    Jul 2001
    Location
    Fitchburg
    Posts
    90

    Arrow File Output

    I am assigning text from an edit box to a string variable and trying to output then string to a text file. I the file created but there are some symbols and a "null" and the end of the line. This is the code I used:
    try
    {
    ostream = new DataOutputStream(new FileOutputStream("temp.dat"));
    ostream.writeUTF(stCombinedRecord);
    ostream.close();

    }
    catch(IOException e)
    {
    System.exit(1);
    }
    Any help is awesome!!!!!!
    Don't ever Ginop before you Ginip

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Pretty good! From what i have read about Swing though
    Graphical components do not make good candidates for IO
    (even though im not to familiar with the edit box
    unless you mean JTextArea) because a stream is an ordered sequence of bytes of an undetermined length. Given a group
    of bytes provided as data, there must be a fixed order to those bytes for them to be read of written as a stream. However a
    user can change the contents of a text area of a text field at any point, not just the end. Furthermore, they can delete data from the middle of a stream while another thread is reading is reading that data.

    You can however always use the strings they produce to create a byte array input stream or a string reader

  3. #3

    Thread Starter
    Lively Member Crazy_bee's Avatar
    Join Date
    Jul 2001
    Location
    Fitchburg
    Posts
    90
    I am using the Edit control in visual j++.
    Don't ever Ginop before you Ginip

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Ahhhh ok. Im not familar with Microsofts version of Java.
    You should switch to Sun's Java. From what i remember when i was in school they dropped J++ from their course because Microsoft was being sued for ripping off Sun. So i think Visual J++ was discontinued. but im not sure.

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width