0

在我的网页上,我正在调用具有一些凭据信息的小程序并尝试打印小程序内容。但我需要隐藏小程序信息。如果假设我试图隐藏编辑窗格或 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);
4

1 回答 1

1

您可以尝试创建另一个JEditorPane实例(可见的)。原件的复印尺寸,设置相同EditorKit,并设置从原件获得的文件。

然后printAll()是新实例。

于 2013-09-05T08:14:38.010 回答