This solution worked pretty well for me, but I wanted to make my code automatically detect the second screen's location and dimensions. This required using GraphicsConfiguration or GraphicsDevice.
I modified some code I found from Java's 2D API, (sorry, I can't post the link since this is my first post, but just google "Rendering in a Multi-Screen Environment" and it should come up first.)
Then I combined it with some some of the code posted above. It works pretty well, as long as you don't change the screen resolution or positioning while the applet is running
Also, I'm not using opengl, so I don't know what would change if you were.
Code:Rectangle monitor = new Rectangle();
void setup() {
// Get second screen details and save as Rectangle monitor
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
// gs[1] gets the *second* screen. gs[0] would get the primary screen
GraphicsDevice gd = gs[1];
GraphicsConfiguration[] gc = gd.getConfigurations();
monitor = gc[0].getBounds();
println(monitor.x + " " + monitor.y + " " + monitor.width + " " + monitor.height);
size(monitor.width, monitor.height);
background(0);
}
void draw() {
frame.setLocation(monitor.x, monitor.y);
frame.setAlwaysOnTop(true);
stroke(255);
line(0,0,width/2,height/2);
}
public void init() {
frame.removeNotify();
frame.setUndecorated(true);
super.init();
}
Hope this helps someone!