Java Graphics Environment isInteractive()

Here you can find the source of isInteractive()

Description

is Interactive

License

Open Source License

Return

true if there is a user you can ask for input. true by default. <p> This is set by the environment variable WINTERWELL_HEADLESS, with WINTERWELL_HEADLESS=true meaning interactive is false. See http://blog.plover.com/prog/sh-flags.html <p> If not set, it uses

Declaration

public static boolean isInteractive() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.GraphicsEnvironment;

public class Main {
    /**//from  w w  w . jav a  2 s.c om
     * @return true if there is a user you can ask for input. true by
     *         default.
     *         <p>
     *         This is set by the environment variable WINTERWELL_HEADLESS, with
     *         WINTERWELL_HEADLESS=true meaning interactive is false. See
     *         http://blog.plover.com/prog/sh-flags.html
     *         <p>
     *         If not set, it uses {@link GraphicsEnvironment#isHeadless()}
     */
    public static boolean isInteractive() {
        String envVar = System.getProperty("WINTERWELL_HEADLESS");
        if (envVar == null)
            return !GraphicsEnvironment.isHeadless();
        return !envVar.toLowerCase().equals("true");
    }
}

Related

  1. getLocalGraphicsEnvironment()
  2. getMaximumWindowBounds()
  3. getMaximumWindowDimension()
  4. getMenuShortCutKeyMask()
  5. getWindowMaxBounds()