我正在Eclipse中使用Processing 2.0,关于运行应用程序时从窗口模式到全屏模式的转换有一个问题(不是在启动时选择窗口模式或全屏模式,这很容易解决)。
这个问题解决了从Java Processing的全屏模式转换为窗口模式的问题。
然而,我也想知道如何使用Processing从窗口模式转换回全屏模式。有人有这个问题的解决方案吗?
我正在Eclipse中使用Processing 2.0,关于运行应用程序时从窗口模式到全屏模式的转换有一个问题(不是在启动时选择窗口模式或全屏模式,这很容易解决)。
这个问题解决了从Java Processing的全屏模式转换为窗口模式的问题。
然而,我也想知道如何使用Processing从窗口模式转换回全屏模式。有人有这个问题的解决方案吗?
import java.awt.Frame;
Frame fullScreenFrame;
void setup(){
fullScreenFrame = new Frame();
fullScreenFrame.setUndecorated(true);//prepare an undecorated fullscreen frame since java won't allow you to 'undecorate' a frame after it's been set visible
fullScreenFrame.setBounds(0,0,displayWidth,displayHeight);
fullScreenFrame.addKeyListener(getKeyListeners()[0]);//pass key events from this applet to the fullScreen Frame
}
void draw(){
background((float)mouseX/width * 255,(float)mouseY/height * 255,0);
}
void keyReleased(){
if(key == 'f') {
setBounds(0,0,displayWidth,displayHeight);//resize the skech
fullScreenFrame.add(frame.getComponent(0));//add the applet to the fullscreen frame from Processing's frame
fullScreenFrame.setVisible(true);//make our fullscreen frame visible
frame.setVisible(false );//and hide Processing's frame
}
}