We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, Earlier today I was going through some of my old 1.5.1 Processing sketches and testing them with 2.x. I encountered a number of things that no longer worked but was able to fix them. However one sketch made use of undecorated frames as documented here: wiki.processing.org/w/Undecorated_frame
I also found a forum post on the subject here: forum.processing.org/one/topic/full-screen-approach.html
When I try to use frame.whatevermethod() with the Java renderer I get a mysterious NullPointerException. If I try to use frame.whatevermethod() with the OPENGL renderer I get a java.lang.NullPointerException
Here is the ultra-stripped down code from my original PDE that I used to identify frame as being the source of the problem.
void setup() {
size(800, 600);
frame.removeNotify();
frame.setUndecorated(true);
}
void draw() {
ellipse(frameCount%width,100,50,50); // output draw test
// if(frameCount == 2) { frame.setLocation(0,0); }
}
Note this is with the 32 bit version of Processing 2 on a 64bit Windows 7 platform. I haven't tested this with the 64 bit version of Processing 2 but have no reason to believe that it would behave differently.
Answers
I noticed that as well. Strangely,
frame.setTitle()
works, so it's notframe
that isnull
.Wow, Adding the frame.addNotify(); statement (which I never used with 1.5.1) eliminates the error but only for the Java renderer.
Make that size(800,600, OPENGL) and the java.lang.NullPointerException rears its ugly head.
My very 1st reply was exactly about
frame.setUndecorated(true);
for OPENGL modes -> P2D & P3D! :-t