so I'm making a program with a "controller" and two display screen's, kinda like Powerpoint when you press slideshow its open on the second screen in fullscreen. I have manage to do it with only two screens but every time I try with three I get a null pointer. here is my code:
import javax.imageio.ImageIO;
public class Program extends Canvas implements Runnable{
private static final long serialVersionUID = -7579474834886333524L;
private Thread thread;
private boolean isRunning = false;
private Måler måler;
private MålerLille målerlille;
public Program() {
new Controller();
målerlille = new MålerLille(1920, 1080, "screen3", this);
måler = new Måler(1920, 1080, "screen2", this);
GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
gs[2].setFullScreenWindow(MålerLille.frameML);
gs[1].setFullScreenWindow(Måler.frame);