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.
What you can do is write to a file and then you can use Desktop class to print it. for more infomation on desktop class go here
here is the program
import java.awt.Desktop;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class abc {
public static void main(String[] args) throws IOException{
BufferedWriter out = new BufferedWriter(new FileWriter("1.txt"));
out.write("Hello this is a test");
out.flush();
out.close();
File ff = new File("1.txt");
Desktop desktop = Desktop.getDesktop();
desktop.print(ff);
}
}