0

jFrame から印刷したいのですが、printutility と印刷に必要なものをすべて使用できます。今私の問題は、jFrameを印刷するためにjFrameをプリンタに送信する方法です。

jFrameまたはその他のソリューションから印刷することは可能ですか?

4

2 に答える 2

0

便利なリンク..

1.JFrame +そのコンテンツの印刷2.jFrameの印刷
3.高度な印刷4.Swingコンポーネントの印刷

于 2012-06-11T05:59:13.537 に答える
0

You should take an image of the JFrame by painting the component to an image, and then send the image to a printer using the java.awt.print API.

public static BufferedImage takeScreenshot(Component comp) {
    BufferedImage image = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
    component.paint(image.getGraphics());
    return image;
}
于 2012-06-11T05:35:47.477 に答える