This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Query regarding Applet Printing.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to send some data to a printer from an
applet. I am able to do this with setPrintable()
method of PrinterJob. drawString method of Graphics2D
displays it and then print() method of PrinterJob
prints it. Using this it prints whatever is displayed.
But I want the data not to be displayed by the applet.
Without displaying the data, the applet should send it
to the printer.
Can you please help me.
Thanks
 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Susan,

Perhaps you could make the printer stuff into a separate class and call that class from the applet. If you can isolate the display stuff in the applet to a JPanel, then you can call that JPanel from your printing class without actually showing it.

I am surprised that your can print from the applet at all because of the secure sandbox it runs in. Perhaps you running it from appletviewer in which case it probably will not work in a browser, or perhaps you have a security permissions file?

Ed
 
reply
    Bookmark Topic Watch Topic
  • New Topic