0

我正在创建一个打印带有下划线页眉和页脚的多页文档的程序。我的文档在 JTextPane 中。JComponent 类的打印方法为:

JTextComponent.print(MessageFormat headerFormat, MessageFormat footerFormat, 
boolean showPrintDialog, PrintService service, PrintRequestAttributeSet attributes,
boolean interactive)

打印我的文档以及作为 headerFormat 和 footerFormat 响应传递的页眉和页脚。但是,我需要在页眉和页脚下加上下划线以及更改其字体大小。

请帮帮我。

4

1 回答 1

1

See http://java-sl.com/articles.html 4 articles about printing of JTextPane with custom header and footer. The article about headers and footers.

Alternatively you can try this one to print/preview content. It would require custom header/footer implementation but also it's possibly.

于 2013-10-11T05:22:31.897 回答