public int print(Graphics gr, PageFormat pageFormat, int pageIndex)
throws PrinterException {
if (pageIndex != 0)
return NO_SUCH_PAGE;
Graphics2D g = (Graphics2D) gr;
double x = pageFormat.getImageableX();
double y = pageFormat.getImageableY();
double w = pageFormat.getImageableWidth();
double h = pageFormat.getImageableHeight();
double sx = w / myComponent.getWidth();
double sy = h / myComponent.getHeight();
g.translate(x, y);
g.scale(sx, sy);
//geht so definitiv nicht
gr.drawImage(image, 5, 5, null);
// so bekomm ich den rahmen mit:-|
//myComponent.print(gr);
return PAGE_EXISTS;
}