• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java swing crossFeedResolution < 1 problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My application has a print screen button. Off late a few clients have sent in a few error reports. This is an example stack trace:

StackTrace:


I have not been able to duplicate the problem myself but a client told me that this happens often (does'nt happen everytime they click the "Print Screen" button), and when it fails it causes the application to freeze and they have to terminate the app using the "Task Manager".

Here is the action my "Print Screen" button is bound to:



Here is my implementation of the PrintUtilities class, with the print methods:

 
Sheriff
Posts: 22787
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tags. I've added them for you this time, and look how much easier it is to read your code.

The stack trace tells you a lot of where the problem is coming from:This tells me that the problem is in the PrinterResolution constructor that is called. This constructor takes a crossFeedResolution that it uses in calling the super constructor. Now the bad news. This PrinterResolution instance is created by one of Sun's internal classes, sun.awt.windows.WPrinterJob. I don't have the source of that.

The rest of the stack trace informs me that the issue is not caused by your code but by the Java API instead. When the print dialog is shown (sun.awt.windows.WPrintDialogPeer._show) this is setting the resolution but it can't determine it, thereby passing -1 to the PrinterResolution constructor. I can't tell you how to solve this though. Perhaps it simply is a matter of incorrect printer drivers, or something else outside the world of Java.
 
Girish Vankayala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You for your reply Rob. I will make sure I use the "code" tags next time. That was my first post

I heard today that there is more than one client with the same problem. I will ask one who had this problem yesterday to update their printer drivers and check if it fixes the problem. We usually tell the clients to update their Java when we have a problem like this but this client is on Java 1.6.0_17.

Thank You again for your reply.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic