R
Richard Lewis
I have 2 Canvas objects that I want to print next to each other on a page.
How can I adjust where they appear so one does not print over the other?
class PaintContent implements Printable {
private CustomCanvas c;
private ZoomCanvas z;
public PaintContent(int x, int y, int zoom)
{
c = new CustomCanvas();
z = new ZoomCanvas(x,y,zoom);
}
public int print(Graphics g, PageFormat pf, int pageIndex)
throws PrinterException {
c.paint((Graphics2D) g);
z.paint((Graphics2D) g);
return Printable.PAGE_EXISTS;
}
}
How can I adjust where they appear so one does not print over the other?
class PaintContent implements Printable {
private CustomCanvas c;
private ZoomCanvas z;
public PaintContent(int x, int y, int zoom)
{
c = new CustomCanvas();
z = new ZoomCanvas(x,y,zoom);
}
public int print(Graphics g, PageFormat pf, int pageIndex)
throws PrinterException {
c.paint((Graphics2D) g);
z.paint((Graphics2D) g);
return Printable.PAGE_EXISTS;
}
}