Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Applets
Expertise: Beginner
Mar 19, 1997

Can Browser Print Applet's Output?

Question:
I have written an applet that creates a graph from the results of 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 the applet will print fine, but there will just be a big blank spot where the graph should be.

Answer:
That is normal. Unfortunately, Netscape makes no effort to find out what the Java program draws onto the screen. (It could, in theory, try to have that subwindow redraw itself and capture the output, then scale the screen pixels to the printer. But it doesn't.) And, there is no Java API 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 and printing support. When that happy moment comes, your Java applications will be able to print. Whether or not that capability will extend to applets is anyone's guess for now.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date