简体   繁体   English

在打印Java Swing时实现带下划线的页眉和页脚

[英]Implementing underlined header and footer while printing Java Swing

I am creating a program that prints a multipage document with underlined header and footer. 我正在创建一个程序,该程序打印带有下划线的页眉和页脚的多页文档。 My document is in a JTextPane. 我的文档在JTextPane中。 The print method of JComponent class is: JComponent类的打印方法是:

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

prints my document along with a header and footer passed as headerFormat and footerFormat response. 打印我的文档以及作为headerFormat和footerFormat响应传递的页眉和页脚。 However I need to underline the header and footer along with changing its font size. 但是,我需要在页眉和页脚下划线并更改其字体大小。

Please help me out. 请帮帮我。

See http://java-sl.com/articles.html 4 articles about printing of JTextPane with custom header and footer. 请参阅http://java-sl.com/articles.html 4篇有关使用自定义页眉和页脚打印JTextPane的文章。 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. 它需要自定义的页眉/页脚实现,但也有可能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM