

+" "+ gdTmp.getDefaultConfiguration().getBounds() ) "Screen(" + gdTmp.getDefaultConfiguration().getDevice().getIDstring() +")" GetContentPane().setBackground(Color.black) GraphicsDevice gda = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() Private static final long serialVersionUID = 3493635987367217622L įinal JButton button = new JButton("click to exit") ītBorder(BorderFactory.createEmptyBorder()) īutton.addActionListener(new void actionPerformed(ActionEvent arg0) It takes a single argument 0 to max display-1.įor example: java -jar Dimmer.jar 1 will blacken my second monitor, no arguments will assume display 0 import (which I can launch remotely using other tools).īelow is the java code that I have tested on Windows 7.

In order to maximize my laziness I created a simple Java app to blacken the display I can turn on my PC/media player/lights remotely but my 27" computer display throws a distracting glow across the room. This post is a bit old but I ran into a similar issue.
