Printing in an applet from javascript

Discussion in 'Javascript' started by KenH, Aug 16, 2005.

  1. KenH

    KenH Guest

    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?
    KenH, Aug 16, 2005
    #1
    1. Advertising

  2. KenH

    VK Guest

    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?
    VK, Aug 16, 2005
    #2
    1. Advertising

  3. KenH

    KenH Guest

    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.
    KenH, Aug 17, 2005
    #3
  4. 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/
    Martin Honnen, Aug 17, 2005
    #4
  5. KenH

    VK Guest

    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 ;-)
    VK, Aug 17, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    607
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    843
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    402
    Andrew Thompson
    Aug 5, 2003
  4. Blah Blah
    Replies:
    0
    Views:
    1,421
    Blah Blah
    Aug 13, 2003
  5. crazytazo
    Replies:
    3
    Views:
    1,248
    Daniel Pitts
    Oct 7, 2008
Loading...

Share This Page