printerjob.html
来自「API資料大全」· HTML 代码 · 共 596 行 · 第 1/2 页
HTML
596 行
<TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getPrinterJob()"><!-- --></A><H3>getPrinterJob</H3><PRE>public static <A HREF="../../../java/awt/print/PrinterJob.html">PrinterJob</A> <B>getPrinterJob</B>()</PRE><DL><DD>Creates and returns a <code>PrinterJob</code>.<DD><DL><DT><B>Returns:</B><DD>a new <code>PrinterJob</code>.</DL></DD></DL><HR><A NAME="setPrintable(java.awt.print.Printable)"><!-- --></A><H3>setPrintable</H3><PRE>public abstract void <B>setPrintable</B>(<A HREF="../../../java/awt/print/Printable.html">Printable</A> painter)</PRE><DL><DD>Calls <code>painter</code> to render the pages. The pages in the document to be printed by this <code>PrinterJob</code> are rendered by the <A HREF="../../../java/awt/print/Printable.html"><CODE>Printable</CODE></A> object, <code>painter</code>. The <A HREF="../../../java/awt/print/PageFormat.html"><CODE>PageFormat</CODE></A> for each page is the default page format.<DD><DL><DT><B>Parameters:</B><DD><CODE>painter</CODE> - the <code>Printable</code> that renders each page of the document.</DL></DD></DL><HR><A NAME="setPrintable(java.awt.print.Printable, java.awt.print.PageFormat)"><!-- --></A><H3>setPrintable</H3><PRE>public abstract void <B>setPrintable</B>(<A HREF="../../../java/awt/print/Printable.html">Printable</A> painter, <A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> format)</PRE><DL><DD>Calls <code>painter</code> to render the pages in the specified <code>format</code>. The pages in the document to be printed by this <code>PrinterJob</code> are rendered by the <code>Printable</code> object, <code>painter</code>. The <code>PageFormat</code> of each page is <code>format</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>painter</CODE> - the <code>Printable</code> called to render each page of the document<DD><CODE>format</CODE> - the size and orientation of each page to be printed</DL></DD></DL><HR><A NAME="setPageable(java.awt.print.Pageable)"><!-- --></A><H3>setPageable</H3><PRE>public abstract void <B>setPageable</B>(<A HREF="../../../java/awt/print/Pageable.html">Pageable</A> document) throws <A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></PRE><DL><DD>Queries <code>document</code> for the number of pages and the <code>PageFormat</code> and <code>Printable</code> for each page held in the <code>Pageable</code> instance, <code>document</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>document</CODE> - the pages to be printed. It can not be <code>null</code>.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - the <code>Pageable</code> passed in was <code>null</code>.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/print/PageFormat.html"><CODE>PageFormat</CODE></A>, <A HREF="../../../java/awt/print/Printable.html"><CODE>Printable</CODE></A></DL></DD></DL><HR><A NAME="printDialog()"><!-- --></A><H3>printDialog</H3><PRE>public abstract boolean <B>printDialog</B>()</PRE><DL><DD>Presents a dialog to the user for changing the properties of the print job.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if the user does not cancel the dialog; <code>false</code> otherwise.</DL></DD></DL><HR><A NAME="pageDialog(java.awt.print.PageFormat)"><!-- --></A><H3>pageDialog</H3><PRE>public abstract <A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> <B>pageDialog</B>(<A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> page)</PRE><DL><DD>Displays a dialog that allows modification of a <code>PageFormat</code> instance. The <code>page</code> argument is used to initialize controls in the page setup dialog. If the user cancels the dialog then this method returns the original <code>page</code> object unmodified. If the user okays the dialog then this method returns a new <code>PageFormat</code> object with the indicated changes. In either case, the original <code>page</code> object is not modified.<DD><DL><DT><B>Parameters:</B><DD><CODE>page</CODE> - the default <code>PageFormat</code> presented to the user for modification<DT><B>Returns:</B><DD>the original <code>page</code> object if the dialog is cancelled; a new <code>PageFormat</code> object containing the format indicated by the user if the dialog is acknowledged.<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="defaultPage(java.awt.print.PageFormat)"><!-- --></A><H3>defaultPage</H3><PRE>public abstract <A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> <B>defaultPage</B>(<A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> page)</PRE><DL><DD>Clones the <code>PageFormat</code> argument and alters the clone to describe a default page size and orientation.<DD><DL><DT><B>Parameters:</B><DD><CODE>page</CODE> - the <code>PageFormat</code> to be cloned and altered<DT><B>Returns:</B><DD>clone of <code>page</code>, altered to describe a default <code>PageFormat</code>.</DL></DD></DL><HR><A NAME="defaultPage()"><!-- --></A><H3>defaultPage</H3><PRE>public <A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> <B>defaultPage</B>()</PRE><DL><DD>Creates a new <code>PageFormat</code> instance and sets it to a default size and orientation.<DD><DL><DT><B>Returns:</B><DD>a <code>PageFormat</code> set to a default size and orientation.</DL></DD></DL><HR><A NAME="validatePage(java.awt.print.PageFormat)"><!-- --></A><H3>validatePage</H3><PRE>public abstract <A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> <B>validatePage</B>(<A HREF="../../../java/awt/print/PageFormat.html">PageFormat</A> page)</PRE><DL><DD>Returns the clone of <code>page</code> with its settings adjusted to be compatible with the current printer of this <code>PrinterJob</code>. For example, the returned <code>PageFormat</code> could have its imageable area adjusted to fit within the physical area of the paper that is used by the current printer.<DD><DL><DT><B>Parameters:</B><DD><CODE>page</CODE> - the <code>PageFormat</code> that is cloned and whose settings are changed to be compatible with the current printer<DT><B>Returns:</B><DD>a <code>PageFormat</code> that is cloned from <code>page</code> and whose settings are changed to conform with this <code>PrinterJob</code>.</DL></DD></DL><HR><A NAME="print()"><!-- --></A><H3>print</H3><PRE>public abstract void <B>print</B>() throws <A HREF="../../../java/awt/print/PrinterException.html">PrinterException</A></PRE><DL><DD>Prints a set of pages.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/awt/print/PrinterException.html">PrinterException</A></CODE> - an error in the print system caused the job to be aborted.<DT><B>See Also: </B><DD><A HREF="../../../java/awt/print/Book.html"><CODE>Book</CODE></A>, <A HREF="../../../java/awt/print/Pageable.html"><CODE>Pageable</CODE></A>, <A HREF="../../../java/awt/print/Printable.html"><CODE>Printable</CODE></A></DL></DD></DL><HR><A NAME="setCopies(int)"><!-- --></A><H3>setCopies</H3><PRE>public abstract void <B>setCopies</B>(int copies)</PRE><DL><DD>Sets the number of copies to be printed.<DD><DL><DT><B>Parameters:</B><DD><CODE>copies</CODE> - the number of copies to be printed</DL></DD></DL><HR><A NAME="getCopies()"><!-- --></A><H3>getCopies</H3><PRE>public abstract int <B>getCopies</B>()</PRE><DL><DD>Gets the number of copies to be printed.<DD><DL><DT><B>Returns:</B><DD>the number of copies to be printed.</DL></DD></DL><HR><A NAME="getUserName()"><!-- --></A><H3>getUserName</H3><PRE>public abstract <A HREF="../../../java/lang/String.html">String</A> <B>getUserName</B>()</PRE><DL><DD>Gets the name of the printing user.<DD><DL><DT><B>Returns:</B><DD>the name of the printing user</DL></DD></DL><HR><A NAME="setJobName(java.lang.String)"><!-- --></A><H3>setJobName</H3><PRE>public abstract void <B>setJobName</B>(<A HREF="../../../java/lang/String.html">String</A> jobName)</PRE><DL><DD>Sets the name of the document to be printed. The document name can not be <code>null</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>jobName</CODE> - the name of the document to be printed</DL></DD></DL><HR><A NAME="getJobName()"><!-- --></A><H3>getJobName</H3><PRE>public abstract <A HREF="../../../java/lang/String.html">String</A> <B>getJobName</B>()</PRE><DL><DD>Gets the name of the document to be printed.<DD><DL><DT><B>Returns:</B><DD>the name of the document to be printed.</DL></DD></DL><HR><A NAME="cancel()"><!-- --></A><H3>cancel</H3><PRE>public abstract void <B>cancel</B>()</PRE><DL><DD>Cancels a print job that is in progress. If <A HREF="../../../java/awt/print/PrinterJob.html#print()"><CODE>print</CODE></A> has been called but has not returned then this method signals that the job should be cancelled at the next chance. If there is no print job in progress then this call does nothing.</DL><HR><A NAME="isCancelled()"><!-- --></A><H3>isCancelled</H3><PRE>public abstract boolean <B>isCancelled</B>()</PRE><DL><DD>Returns <code>true</code> if a print job is in progress, but is going to be cancelled at the next opportunity; otherwise returns <code>false</code>.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if the job in progress is going to be cancelled; <code>false</code> otherwise.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PrinterJob.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../java/awt/print/Paper.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="PrinterJob.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?