Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Componets Not Printing on One Page in Java 1.6.  RSS feed

 
Jared Sheehan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Basically the problem is this, we upgraded from 1.5 to 1.6 and now our components do not not print anymore.

We resized them to fit perfectly on a page and printed and it worked great. Now it looks like the font is not scaling down automatically anymore. Any ideas on what to do?

Resizing the Component---


Component component = windowManager.getSelectedFrame();
int height = component.getHeight();
int width = component.getWidth();
int modWidth = 850;
component.setSize(new Dimension(modWidth, height));
PrintDelegateEnboss.print(component);
component.setSize(new Dimension(width, height));

Printing ------

PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(component);
boolean ok = job.printDialog();
if (ok) {
try {
job.print();
} catch (PrinterException ex) {
/* The job did not successfully complete */
}
}
Thanks For the help

Jared
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jared Sheehan wrote:
} catch (PrinterException ex) {
/* The job did not successfully complete */
}

That's a bad idea, just ignoring your exceptions like that, unless you are 100.000% sure they cannot occur. Maybe a PrinterException is thrown and that is causing the problems.

Also, please Use Code Tags.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!