Printing a file using system default printer
Posted by
neo
on Tuesday, June 16, 2009
design by Free CSS Templates, blogger design by TeknoMobi
import
java.awt.Desktop;
import java.io.File;
import java.io.IOException;
public class Test {
public static void main(String[] a) {
try {
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
desktop.print(new File("c:\\a.txt"));
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
Copyright (c) 2009 All About Java. All rights reserved. Design by Free CSS Templates Blogspot Templates Created by TeknoMobi.
0 comments:
Post a Comment