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
I know this thread is old but I found it while searching on how to do the same thing myself. I couldn't find any solutions I wanted to use so I came up with this. I found that the below solution not only works but is also much simpler than the above answers.
JFrame frame = new JFrame();
frame.setResizable(false);
frame.setUndecorated(true);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(dim);
frame.setVisible(true);