Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.print.ServiceUI
ServiceUI
provides a method to create a graphical
print dialog.
The graphical print dialog enables the user to browse the available print services on the system. It provides user interfaces to interact with the most common printing attributes likes specifying the number of copies to print or the page ranges.
The initial appearance of the print dialog as shown to the user may be specified by providing the default selected print service as well as initial values for the printing attributes in the user interface.
Constructor Summary | |
|
Method Summary | |
static PrintService |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static PrintService printDialog(GraphicsConfiguration gc, int x, int y, PrintService[] services, PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes) throws HeadlessException
Creates a modal graphical printing dialog at the specified location on the screen.The dialog will return the user selected print service and the given attributes set will contain the modified printing attributes. If the user cancels the printing dialog
null
will be returned and the printing attributes set will be unmodified.The values of the given attributes set (if not empty) will be displayed initially unless the are unsupported by the print service. If a print service does not support a particular value it is substituted with the default value of the print service.
- Parameters:
gc
- the screen to use.null
is default screen.x
- the coordinate of the upper left edge of the dialog in screen coordinates (not relative to the parent frame).y
- the coordinate of the upper left edge of the dialog in screen coordinates (not relative to the parent frame).services
- the print services to browse (not null).defaultService
- the default service. Ifnull
the first of the print services in the services array will be used.flavor
- the flavours to be printed.attributes
- the attributes requested. Will be updated by selections done by the user in the dialog.
- Returns:
- The selected print service or
null
if user has cancelled the printer dialog.
- Throws:
HeadlessException
- if GraphicsEnvironment is headlessIllegalArgumentException
- if services isnull
or an empty array, attributes arenull
or the given defaultPrintService
is not part of the print service array.