I don\'t even know if this is possible and I highly doubt it is, but if you can, can you please tell me how? I just want to know how to print some text from a printer.
Here is something that is even easier.
import javax.swing.JTextPane;
import java.awt.print.PrinterException;
public class TestPrint {
public static void main(String[] args) throws PrinterException {
JTextPane textPane = new JTextPane();
textPane.setText("test text string - Hello World! Are you there?");
textPane.print();
}
}
Output: popup