Example usage for java.awt SystemColor ACTIVE_CAPTION

List of usage examples for java.awt SystemColor ACTIVE_CAPTION

Introduction

In this page you can find the example usage for java.awt SystemColor ACTIVE_CAPTION.

Prototype

int ACTIVE_CAPTION

To view the source code for java.awt SystemColor ACTIVE_CAPTION.

Click Source Link

Document

The array index for the #activeCaption system color.

Usage

From source file:Main.java

public static void main(String[] args) {
    System.out.println(SystemColor.ACTIVE_CAPTION);

}

From source file:org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngineTest.java

@Test
public void shouldAllowsMultipleImports() throws Exception {
    final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(
            (CompilerCustomizerProvider) NoImportCustomizerProvider.INSTANCE);
    try {//w ww .j a  v  a2  s  . co  m
        engine.eval("Color.RED");
        fail("Should have thrown an exception because no imports were supplied");
    } catch (Exception se) {
        assertTrue(se instanceof ScriptException);
    }

    try {
        engine.eval("SystemColor.ACTIVE_CAPTION");
        fail("Should have thrown an exception because no imports were supplied");
    } catch (Exception se) {
        assertTrue(se instanceof ScriptException);
    }

    engine.addImports(new HashSet<>(Arrays.asList("import java.awt.Color")));
    assertEquals(Color.RED, engine.eval("Color.RED"));

    engine.addImports(new HashSet<>(Arrays.asList("import java.awt.SystemColor")));
    assertEquals(Color.RED, engine.eval("Color.RED"));
    assertEquals(SystemColor.ACTIVE_CAPTION, engine.eval("SystemColor.ACTIVE_CAPTION"));
}