Hello all!
After quite a bit of searching, I haven't found any answers.
I have a java program which generates PDFs which I then want to print. However, apparently Java thinks printing isn't supported on my platform (Fedora 13 x86).
Basically, I find out with the following code:
Code:
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
if (desktop.isSupported(Desktop.Action.PRINT)) {
System.out.println("Printing is supported");
desktop.print(new File(printP));
} else {
//System.out.println("Printing NOT supported");
JOptionPane.showMessageDialog(this, "Printing not supported on this platform!");
}
When running on my test machine desktop.isSupported(Desktop.Action.PRINT) returns false so that I get exceptions when I call desktop.print().
I've made sure that I have a default printer setup, and it works. I haven never had issues printing, just now from my app.
Any ideas? Is it a system configuration thing or a Java thing?
Some other info:
Code:
[tja@area51m ~]$ uname -r
2.6.33.8-149.fc13.i686
[tja@area51m ~]$ lpstat -d
system default destination: KONICA_MINOLTA_bizhub_223_7A_21_65_
EDIT: nevermind that bad code where I don't check to see if desktop is still null. ;P
Thanks!!!