Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printerjob, awt headless mode and mac os x server

 
gianni drughi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
i've an application that print a page using classes like jframe, jpanel, jtable, etc
when i run it on a linux server or on a windows one there are no problems, but when i try to print this page on mac os x server 10.6.8 i get this error:
on system dock appear a java icon named org.apache.catalina.startup.Bootstrap and the printed page comes empty. if i set the visibility property to true i can see the correct page, but i can't print!
I've searched on google and i found various articles that say to set JAVA_OPTS to awt headless = true. i've tryed but i've obtained an headlessexception, because i use jframe etc that need headless mode disactive...so what can i do?

i want to print with a shared network windows printer, if i print with textedit all go well, the problem appears only using java PrinterService class

thanks in advance
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you've set the option correctly, can you post us the code that tries to do the printing?
 
gianni drughi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah i think i've set the option correctly because i get an headlessException, so this is my code




so at the frame.setVisible(true) i can see the well constructed document, meanwhile with the line pj.print(attr) i print a white paper
any ideas?

thanks for the reply rob
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't display a frame if you have nothing to display the frame on, which is usually the case for servers. If you think the frame will display on the client you're mistaken.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic