Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

print writer

 
ray bond
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello there,
I am trying to use below code to use print writer ,
import java.io.*;
import java.net.*;
import java.awt.event.*;
import java.awt.*;
import java.applet.*;

public class OutPut extends Applet
{

public void init()
{
try{

URL url = new URL("http://server1/vippast/hello.txt");
URLConnection urlcon = url.openConnection();
urlcon.setDoOutput(true);
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
PrintWriter pt = new PrintWriter(baos,true);
String str = "this is output applet " ;
pt.println(str);
pt.flush();
pt.close();
baos.close();

System.out.println("printwriter printed to " + url + ";" + str);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
do I have to save "hello.txt" file on server1 or this program creates it , where does "printwriter.print(string) " statement produces result , in "hello.txt" ?
thanks


[This message has been edited by ray bond (edited November 17, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic