gpt4 book ai didi

Java Applet 和打印

转载 作者:行者123 更新时间:2023-12-01 14:09:35 25 4
gpt4 key购买 nike

从我的网页上,我调用具有一些凭据信息的小程序,并尝试打印小程序内容。但我需要隐藏小程序信息。如果假设我正在尝试隐藏编辑器 Pane 或 Jframe,则纸张将显示为空白。

    //Print function

Graphics2D g2d = (Graphics2D) g;
g2d.translate(pageFormat.getImageableX(), pageFormat
.getImageableY());
disableDoubleBuffering(componentToBePrinted);
componentToBePrinted.paint(g2d);
enableDoubleBuffering(componentToBePrinted);
return (PAGE_EXISTS);

// applet

jbInit();
this.accessParamEditorPane.setEditable(false);
Font f = new Font("Arial", 1, 9);
this.accessParamEditorPane.setFont(f);
this.accessParamEditorPane.setText(Body);
//this.setVisible(false);
//accessParamEditorPane.setVisible(false);
new PrintModule(this);
dispose();
setFocusableWindowState(false);

最佳答案

您可以尝试创建另一个 JEditorPane 实例(可见)。复制原始文件的大小,设置相同的 EditorKit 并设置从原始文件获取的文档。

然后printAll()新实例。

关于Java Applet 和打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18629817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com