Skip to content

Instantly share code, notes, and snippets.

@renatoathaydes
Last active December 26, 2015 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renatoathaydes/7071189 to your computer and use it in GitHub Desktop.
Save renatoathaydes/7071189 to your computer and use it in GitHub Desktop.
Groovy script that prints information about the graphics devices currently in use.
import java.awt.*
def virtualBounds = new Rectangle()
GraphicsEnvironment ge = GraphicsEnvironment.localGraphicsEnvironment
GraphicsDevice[] gs = ge.screenDevices
println Arrays.toString(gs)
gs.each { GraphicsDevice gd ->
GraphicsConfiguration[] gc = gd.configurations
gc.each {
println "Device: ${it.device} | Bounds: ${it.bounds}"
virtualBounds = virtualBounds.union( it.bounds )
}
}
println "Total bounds: $virtualBounds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment