Printing in an applet from javascript

K

KenH

I have a charting applet that has a print method that works just fine.

My problem is I am trying to initiate the print method from a
javascript routine but it doesn't work.

I access my applet from javascript all the time (feeding data hidden in
a form to the chart), but for some reason trying to launch the printing
from javascript doesn't work. Any ideas? Do I have to set some kind of
focus?
 
V

VK

KenH said:
I have a charting applet that has a print method that works just fine.

My problem is I am trying to initiate the print method from a
javascript routine but it doesn't work.

I access my applet from javascript all the time (feeding data hidden in
a form to the chart), but for some reason trying to launch the printing
from javascript doesn't work. Any ideas? Do I have to set some kind of
focus?

Does not PrintJob stuff require a privilege in the applet? It did
before at least (?)

Is your Java print method declared public?
 
K

KenH

I never thought it needed any kind of privilege -- don't know how to do
that to be honest. I built a separate print class because I use it for
other applets.

I have a button on my applet that initiates the print process. When I
try to start that same process from the javascript...nothing.
 
M

Martin Honnen

KenH said:
I never thought it needed any kind of privilege -- don't know how to do
that to be honest. I built a separate print class because I use it for
other applets.

I have a button on my applet that initiates the print process. When I
try to start that same process from the javascript...nothing.

I am pretty sure the Java console will show more than nothing. I would
check there for any error messages.
 
V

VK

KenH said:
I never thought it needed any kind of privilege -- don't know how to do
that to be honest. I built a separate print class because I use it for
other applets.

I have a button on my applet that initiates the print process. When I
try to start that same process from the javascript...nothing.

Can you pull out the print dialog from the applet itself? Actually you
should go first to <comp.lang.java.help> or <comp.lang.java.security>
and ask if the PrintJob class branch requires applet privileges. I
honnestly do not remember. As well I don't remember if security
exeptions are being shown on the Java console. Any way, round up the
Java issues first, then lets us talk JavaScript ;-)
 

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,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top