We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Dear all, I'm a beginer with Processing so my question might not be posed in the correct manner.
Still, I tried to use the Gplot objects and the related methods provided in the library Grafica. It works fine when the GPlot are manipulated in the MAIN window (i.e. main Draw function). I'm now trying to get the same graphs in an independent window generated with G4P builder. For that, I tried to place the Gplot related code (Gplot objects and manipulation) in the draw handler (win_draw) generated by G4P GUI builder. However, when I'm trying to use the same Gplot objects/methods there, I get consitently the following error :
_An error occured during execution of the eventhandler: CLASS: DataLogger1_1_PDE METHOD: win_draw Caused by java.lang.NullPointerException)
This makes sometime the computer (OSx10.8 / processing3) crashing.
Can anybody share experience/examples on how to pass a Gplot object to the draw handler / independent window + getting the plot drawn there and not in the main.
Thank you in advance for your hep !!!
Answers
Hi @FRV!
Here is an example that displays two plots in two separate windows. I hope it helps you!
I have modified the DefaultPlot example that comes with Graphica to show the plot in a GWindow.
Things to note -
1) The GWindow must be created before the GPlot
2) The parameter used to create the plot must be the GWindow instance (line 27)
3) In the GWindow draw handler we must make sure the
plot
has been created to avoid a NPE (line 43)hi quark,
Work indeed - thanks for that !