< prev index next >

src/java.desktop/share/classes/javax/print/ServiceUI.java

Print this page




 119      * A typical basic usage of this method may be :
 120      * <pre>{@code
 121      * PrintService[] services = PrintServiceLookup.lookupPrintServices(
 122      *                            DocFlavor.INPUT_STREAM.JPEG, null);
 123      * PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
 124      * if (services.length > 0) {
 125      *    PrintService service =  ServiceUI.printDialog(null, 50, 50,
 126      *                                               services, services[0],
 127      *                                               null,
 128      *                                               attributes);
 129      *    if (service != null) {
 130      *     ... print ...
 131      *    }
 132      * }
 133      * }</pre>
 134      *
 135      * @param gc used to select screen. null means primary or default screen.
 136      * @param x location of dialog including border in screen coordinates
 137      * @param y location of dialog including border in screen coordinates
 138      * @param services to be browsable, must be non-null.
 139      * @param defaultService - initial PrintService to display.
 140      * @param flavor - the flavor to be printed, or null.
 141      * @param attributes on input is the initial application supplied
 142      * preferences. This cannot be null but may be empty.
 143      * On output the attributes reflect changes made by the user.
 144      * @return print service selected by the user, or null if the user
 145      * cancelled the dialog.
 146      * @throws HeadlessException if GraphicsEnvironment.isHeadless()
 147      * returns true.
 148      * @throws IllegalArgumentException if services is null or empty,
 149      * or attributes is null, or the initial PrintService is not in the
 150      * list of browsable services.
 151      */
 152     @SuppressWarnings("deprecation")
 153     public static PrintService printDialog(GraphicsConfiguration gc,
 154                                            int x, int y,
 155                                            PrintService[] services,
 156                                            PrintService defaultService,
 157                                            DocFlavor flavor,
 158                                            PrintRequestAttributeSet attributes)
 159         throws HeadlessException
 160     {




 119      * A typical basic usage of this method may be :
 120      * <pre>{@code
 121      * PrintService[] services = PrintServiceLookup.lookupPrintServices(
 122      *                            DocFlavor.INPUT_STREAM.JPEG, null);
 123      * PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
 124      * if (services.length > 0) {
 125      *    PrintService service =  ServiceUI.printDialog(null, 50, 50,
 126      *                                               services, services[0],
 127      *                                               null,
 128      *                                               attributes);
 129      *    if (service != null) {
 130      *     ... print ...
 131      *    }
 132      * }
 133      * }</pre>
 134      *
 135      * @param gc used to select screen. null means primary or default screen.
 136      * @param x location of dialog including border in screen coordinates
 137      * @param y location of dialog including border in screen coordinates
 138      * @param services to be browsable, must be non-null.
 139      * @param defaultService  initial PrintService to display.
 140      * @param flavor  the flavor to be printed, or null.
 141      * @param attributes on input is the initial application supplied
 142      * preferences. This cannot be null but may be empty.
 143      * On output the attributes reflect changes made by the user.
 144      * @return print service selected by the user, or null if the user
 145      * cancelled the dialog.
 146      * @throws HeadlessException if GraphicsEnvironment.isHeadless()
 147      * returns true.
 148      * @throws IllegalArgumentException if services is null or empty,
 149      * or attributes is null, or the initial PrintService is not in the
 150      * list of browsable services.
 151      */
 152     @SuppressWarnings("deprecation")
 153     public static PrintService printDialog(GraphicsConfiguration gc,
 154                                            int x, int y,
 155                                            PrintService[] services,
 156                                            PrintService defaultService,
 157                                            DocFlavor flavor,
 158                                            PrintRequestAttributeSet attributes)
 159         throws HeadlessException
 160     {


< prev index next >