I\'m working on a java swing application that will be used in a psychology experiment and the researchers have requested that I make the program \"black out the screen\" in
Use the Full Screen Java APIs?
http://java.sun.com/docs/books/tutorial/extra/fullscreen/exclusivemode.html
http://www.artificis.hu/2006/03/16/java-awtswing-fullscreen
JFrame fr = new JFrame();
fr.setResizable(false);
if (!fr.isDisplayable()) {
// Can only do this when the frame is not visible
fr.setUndecorated(true);
}
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
try {
if (gd.isFullScreenSupported()) {
gd.setFullScreenWindow(fr);
} else {
// Can't run fullscreen, need to bodge around it (setSize to screen size, etc)
}
fr.setVisible(true);
// Your business logic here
} finally {
gd.setFullScreenWindow(null);
}