[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing in Java





I have an application that needs to print the results of a search query to
the user's printer.
The print functionality works fine when I test the application in my
development environment, 
but when I launch the application via an applet in Netscape to test the
print functionality,
I either get an exception or Netscape crashes depending on the parameter I
provide to the
following method:

This version causes an exception to be thrown saying the owner window is
null, which is the first  parameter.
   Note: The signature for this method is  <  public abstract PrintJob
getPrintJob(Frame frame, String title, Properties props) >. 

   	PrintJob pJob = Toolkit.getDefaultToolkit().getPrintJob( null,
"Print Query Results",  new Properties());

  it works fine in the development environment, but not when I launch the
application from an applet in Netscape.

This version causes a Netscape error which crashes the application in
Netscape

	PrintJob pJob = Toolkit.getDefaultToolkit().getPrintJob( new
Frame(), "Print Query Results",  new Properties());

When I use the application itself as the parameter for the frame, It works
fine in development, but not in the runtime environment

	PrintJob pJob = Toolkit.getDefaultToolkit().getPrintJob( this,
"Print Query Results",  new Properties());

Does anyone know of any reason why this would happen or possible have a
solution.  Your response in greatly 
appreciated.


Eric D. Minor