• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

Hardcopy problem with Windows NT


hello,

i have a problem to print a hardcopy of a frame
i use following function:

public void hardcopy();
{
Toolkit toolkit = this.getToolkit();
PrintJob job = toolkit.getPrintJob(new Frame(), "Hardcopy", printprefs);                
if (job == null)
 return;                  
page = job.getGraphics();
page.drawImage(create_image(), 15, 30, 550, 390, this);
page.dispose();                      
job.end();  
}

public Image create_image()
{
  Image img= createImage(800,600);      
  Graphics page = img.getGraphics();                
  this.printAll(page);
}

i test this function on a windows 2000 computer with the microsoft VM (3805) and it works fine.

but i have a problem with windows nt 40 (SP6a).
when i print the hardcopy, i only get a empty paper.

in the function i draw a image in the graphics context
and this doesn't work. when i use
this.printAll(page);
instead of
page.drawImage(create_image(), 15, 30, 550, 390, this);
i get a hardcopy of the frame.

this method doesn't work on windows nt. i have test with different version of the microsoft vm. but with each one i only get a empty paper?

can anyone help me?

greetings
john



         
0
Agent29
Asked:
Agent29
2 Solutions
 
objectsCommented:
Check that create_image() is actually creating the image correctly, and perhaps use MediaTracker to check that it has completed before trying to print it.
0
 
Tommy BraasCommented:
If you don't have to stick with the MS JVM (and JDK 1.1), I would recommend you to use the PrinterJob class for printing instead PrintJob. I've had some serious problems with the PrintJob class in the past.

I have some code demonstrating the use of PrinterJob.
0
 
CleanupPingCommented:
Agent29:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
TimYatesCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between orangehead911 and objects.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TimYates
EE Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now