Can Browser Print Applet’s Output?

Can Browser Print Applet’s Output?

I have written an applet that creates a graph from the resultsof a query of our Oracle database. The graph looks good in the browser(Netscape 3.0), but if I go to print the broswer page,nothing in my applet shows up. Text and graphics above and below theapplet will print fine, but there will just be a big blank spot where thegraph should be.

That is normal. Unfortunately, Netscape makes no effort to find outwhat the Java program draws onto the screen. (It could, in theory, tryto have that subwindow redraw itself and capture the output, then scalethe screen pixels to the printer. But it doesn’t.) And, there is no JavaAPI for printing.

There will, at some point in the future, be Java support for printing.Sun and Adobe are jointly working on an improved graphics model andprinting support. When that happy moment comes, your Java applicationswill be able to print. Whether or not that capability will extend toapplets is anyone’s guess for now.


Share the Post: