469,592 Members | 1,670 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Printing in an applet from javascript

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
4 1886
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
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


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
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.

Similar topics

5 posts views Thread by java_helloworld | last post: by
1 post views Thread by Tormod Omholt-Jensen | last post: by
3 posts views Thread by Roberto Gallo | last post: by
1 post views Thread by 418928 | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.