We are about to switch to a new forum software. Until then we have removed the registration on this forum.
// forum.Processing.org/two/discussion/17270/
// why-this-getx-method-is-missing-in-processing-3-1-1#Item_5
// GoToLoop (2016-Jun-24)
void setup() {
//size(200,200,P3D);
println(getJFrame(getSurface()).getX());
exit();
}
static final javax.swing.JFrame getJFrame(final PSurface surf) {
return
(javax.swing.JFrame)
((processing.awt.PSurfaceAWT.SmoothCanvas)
surf.getNative()).getFrame();
}
I got cast error in P3D mode
Answers
P3D's surface is PSurfaceJOGL in place of PSurfaceAWT:
https://GitHub.com/processing/processing/blob/master/core/src/processing/opengl/PSurfaceJOGL.java
Its getNative() method returns a com.jogamp.newt.opengl.GLWindow instead of processing.awt.PSurfaceAWT.SmoothCanvas, which then returns a JFrame after getFrame().
I doubt com.jogamp.newt.opengl.GLWindow got anything to do w/ JFrame.
You're gonna need to look that up for yourself. :-\"