fra siden:
http://java.sun.com/people/linden/faq_b2.html// class that opens the printer as a file
// and writes "Hello World" to it
import java.io.*;
public class lpt {
public static void main (String[] argv) {
try {
FileOutputStream os = new FileOutputStream("LPT1");
//wrap stream in "friendly" PrintStream
PrintStream ps = new PrintStream(os);
//print text here
ps.println("Hello world!");
//form feed -- this is important
//Without the form feed, the text will simply sit
// in print buffer until something else gets printed.
ps.print("\f");
//flush buffer and close
ps.close();
} catch (Exception e) {
System.out.println("Exception occurred: " + e);
}
}
}
mvh JakobA