?
Solved

Hardcopy problem with Windows NT

Posted on 2003-03-05
5
Medium Priority
?
216 Views
Last Modified: 2010-03-31

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
Comment
Question by:Agent29
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 8075926
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
 
LVL 14

Accepted Solution

by:
Tommy Braas earned 1000 total points
ID: 8078309
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
 

Expert Comment

by:CleanupPing
ID: 9058897
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
 
LVL 35

Expert Comment

by:TimYates
ID: 9762289
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question