• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query regarding Applet Printing.  RSS feed

 
Susan Varghese
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!