Package java.awt

Examples of java.awt.HeadlessException


     *
     * Throws HeadlessException if Graphics Environment is headless.
    */
    public boolean printDialog() throws HeadlessException {
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }

        if (os.startsWith("Windows")) {         /* Windows OS */
           
            /* call Windows native dialog */
 
View Full Code Here


            throws HeadlessException {

        if (dialogAttrs == null) {
            throw new NullPointerException();
        } else if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }

        /* Combine this PrinterJob attrs attribute set and printerAttrs set
           and resolve MediaPrintableArea/MediaMargins conflict if it is
           needed */
 
View Full Code Here

    */
    public PageFormat pageDialog(PrintRequestAttributeSet arg_attrs)
            throws HeadlessException {

        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        } else if (arg_attrs == null) {
            throw new NullPointerException();
        } else if (getPrintService() == null) {
            JOptionPane.showMessageDialog(KeyboardFocusManager
                    .getCurrentKeyboardFocusManager().getActiveWindow(),
View Full Code Here

                           PrintRequestAttributeSet dialogAttrs,
                           Window owner)
    {
        if (GraphicsEnvironment.isHeadless()) {
            dialogResult = SETUP_ERROR;
            throw new HeadlessException();
        }
   
        if (owner instanceof Frame) {
            printDialog = new JDialog((Frame)owner, "Print", true, gc);
        } else if(owner instanceof Dialog) {
View Full Code Here

   
        dialogType = PAGE_DIALOG;
   
        if (GraphicsEnvironment.isHeadless()) {
            dialogResult = SETUP_ERROR;
            throw new HeadlessException();
        }
   
        if (owner instanceof Frame) {
            printDialog = new JDialog((Frame)owner, "Print", true, gc);
        } else if (owner instanceof Dialog) {
View Full Code Here

        setColor(new Color(c));
    }

    public void setDragEnabled(boolean b) {
        if (b && GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }
        dragEnabled = b;
    }
View Full Code Here

        }
    }

    public Applet() throws HeadlessException {
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }
    }
View Full Code Here

                           PrintRequestAttributeSet dialogAttrs,
                           Window owner)
    {
        if (GraphicsEnvironment.isHeadless()) {
            dialogResult = SETUP_ERROR;
            throw new HeadlessException();
        }
   
        if (owner instanceof Frame) {
            printDialog = new JDialog((Frame)owner, "Print", true, gc);
        } else if(owner instanceof Dialog) {
View Full Code Here

   
        dialogType = PAGE_DIALOG;
   
        if (GraphicsEnvironment.isHeadless()) {
            dialogResult = SETUP_ERROR;
            throw new HeadlessException();
        }
   
        if (owner instanceof Frame) {
            printDialog = new JDialog((Frame)owner, "Print", true, gc);
        } else if (owner instanceof Dialog) {
View Full Code Here

public class ServiceUI {
    public static PrintService printDialog(GraphicsConfiguration gc, int x, int y,
            PrintService[] services, PrintService defaultService, DocFlavor flavor,
            PrintRequestAttributeSet attributes) throws HeadlessException {
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }
        int initialIndex = checkServices(services, defaultService, attributes);
        Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager()
                .getActiveWindow();
        Window dialogOwner = getDialogOwner(activeWindow);
View Full Code Here

TOP

Related Classes of java.awt.HeadlessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.