By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

Printing in an applet from javascript

P: n/a
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?

Aug 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
VK

KenH wrote:
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?

Aug 16 '05 #2

P: n/a
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.

Aug 17 '05 #3

P: n/a


KenH wrote:
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.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 17 '05 #4

P: n/a
VK

KenH wrote:
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 ;-)

Aug 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.