Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: help me

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question help me

    i make a java program that type code on frame . who compaile or run our code on frame output is transfer to our textArea . but when i trasfer that code to a file for save it from io. it save sucessfully but new line is not in my program . every think in single line . what i do help me

    here is my code

    file=new File("C:/vijay");
    System.out.println("documentry created :- "+file.mkdir());
    try
    {
    file=File.createTempFile("JavaApplication",".java" ,file);
    fos=new FileOutputStream(file);
    dos=new DataOutputStream(fos);

    String demo=jta1.getText();
    String demo1[]=demo.split("\n");
    System.out.println(/*demo1[0]+*/" :- "+ch);
    /*dos.writeUTF(demo);

    DataInputStream dis=new DataInputStream(new FileInputStream(file));
    String s=dis.readUTF();
    System.out.println(s);
    jta1.setText(s);*/

    byte b[]=demo.getBytes();
    dos.write(b);

    }catch(Exception e) {System.out.println(e);}

  2. #2
    Junior Member
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help me

    when i open javaApplication.java there all programe in single line . i used so many mathod of io . all method on that program . pls help me what i do

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 262 Times in 231 Posts

    Default Re: help me

    This forum is for saying hi, not for asking questions.
    Please read the forum rules and the sticky at the top of this forum.

  4. #4
    Junior Member
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help me

    soory but i cant able to find option where i create a new thred any other place .

  5. #5
    Junior Member
    Join Date
    Sep 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: help me

    sorry bro . i found "new thread" option . sorry again and help me pls