• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextComponentPrintable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.swing.text.TextComponentPrintable的典型用法代码示例。如果您正苦于以下问题:Java TextComponentPrintable类的具体用法?Java TextComponentPrintable怎么用?Java TextComponentPrintable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextComponentPrintable类属于sun.swing.text包,在下文中一共展示了TextComponentPrintable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPrintable

import sun.swing.text.TextComponentPrintable; //导入依赖的package包/类
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:64,代码来源:JTextComponent.java


示例2: getPrintable

import sun.swing.text.TextComponentPrintable; //导入依赖的package包/类
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:64,代码来源:JTextComponent.java


示例3: getPrintable

import sun.swing.text.TextComponentPrintable; //导入依赖的package包/类
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">
 * How to Use Threads</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:64,代码来源:JTextComponent.java



注:本文中的sun.swing.text.TextComponentPrintable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LocalActivityManager类代码示例发布时间:2022-05-21
下一篇:
Java PlugInFilterRunner类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap