• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

printerjob, awt headless mode and mac os x server

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic