C
carl.manaster
Hi,
I evidently have a fundamental misunderstanding about printing,
components, and layout managers. Please help.
My applet's prepare-to-print code looks something like this:
setDoubleBuffered(false);
Container root = getContentPane();
root.setLocation(leftMargin, topMargin);
root.setSize(pageWidth, pageHeight);
....
root.invalidate();
and I expect that the new dimensions, or, failing that, at least the
invalidate() call, will cause the content pane's layout manager to get
a layoutContainer() call with the page dimensions. Not so. I put
printlns in layoutContainer, and it gets called just fine when the
window is resized, but never for printing (until it's done printing, at
which time it gets called with the screen coordinates).
How do I cause the pane to be laid out specially for printing? I
suppose I could call getLayoutManager().layoutContainer() - probably
that's what I'll try next - but what is the "right" way to do this?
Thanks.
I evidently have a fundamental misunderstanding about printing,
components, and layout managers. Please help.
My applet's prepare-to-print code looks something like this:
setDoubleBuffered(false);
Container root = getContentPane();
root.setLocation(leftMargin, topMargin);
root.setSize(pageWidth, pageHeight);
....
root.invalidate();
and I expect that the new dimensions, or, failing that, at least the
invalidate() call, will cause the content pane's layout manager to get
a layoutContainer() call with the page dimensions. Not so. I put
printlns in layoutContainer, and it gets called just fine when the
window is resized, but never for printing (until it's done printing, at
which time it gets called with the screen coordinates).
How do I cause the pane to be laid out specially for printing? I
suppose I could call getLayoutManager().layoutContainer() - probably
that's what I'll try next - but what is the "right" way to do this?
Thanks.