java.awt.print.PrinterJob not found in applet within JSP.

M

Manoj Nair

I have a applet within a JSP. On click of a button on the screen the
javascript calls a method in the applet. This method inside applet
accesses the PrinterJob function. But during runtime I get a
java.awt.print.PrinterJob class not found. Here is code..

JSP file has applet tag.
<APPLET CODE="PrintApplet.class" NAME="PrintApplet" WIDTH=100
HEIGHT=100>
</APPLET>

function callApplet()
{
document.applets["PrintApplet"].callPrintFunction();
}

Inside the applet I have the callPrintFunction() as follows

PrintJob printJob = java.awt.print.PrinterJob.getPrinterJob();
if (printJob == null) return;
printJob.setCopies(1);
if (printJob.printDialog()) {
}

Please help..Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top