score:1
a bit hacky, but you can try creating a separate awt frame which is fullscreen and drop processing's applet into it. normally for fullscreen you should only need a frame with the screen dimensions and no decorations (title bar, close buttons, etc.) the catch is you can't 'undecorate' a java.awt.frame after it's been set to visible (even if you set visibility to false, attempt to undecorate, then make the frame visible again), so to go around this will simply have a separate frame instance, already undecorated and with the right dimensions into which we drop processing's frame content. also we need to tell processing the bounds are updated.
here's a quick sketch to illustrate the idea(press 'f' for fullscreen):
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
}
}
Source: stackoverflow.com
Related Query
- Java Processing 2.0 (Using Eclipse) : Switching from window to fullscreen and back
- Simple program to call R from Java using Eclipse and Rserve
- What is missing in the following steps to test db connection from eclipse using tomcat and java ?am getting 404 error
- Creating Java Web application project from scratch using eclipse and tomcat?
- Cannot connect from eclipse java to mongo db and I'm not using Maven/Gradle
- Adding image in label from a directory and display in jpanel using java swing and eclipse
- How to insert and retrieve data from database with Web Service in java using JAX - RS and tomcat in eclipse
- Java - Build and run eclipse project from command line
- Kotlin And Java In The Same Project Using Eclipse IDE
- When using Eclipse with FindBugs can you mark a bug as not a bug and have it removed from the bug list?
- Is it possible to build a java project only once using eclipse and share?
- Java JFrame Window not appearing when run from Eclipse
- Best way to debug Java web application packaged as a WAR using Eclipse and Maven?
- Is it possible to use sysout without class and main method in Eclipse IDE using Java 9?
- Java program to connect to Sql Server and running the sample query From Eclipse
- Organize imports of java files using eclipse from command line
- Using fiddler with Java and Eclipse
- Automatic WSDL Java Stub generation in Eclipse Workspace using Apache CXF and CXF Maven Plugin
- How to retrieve data from database using webservices (JAX - RS) in eclipse using Java
- removing java.endorsed.dirs from Tomcat on Eclipse with Java 9 and Java 10
- Using Eclipse SWT Image, JAVA and SQLite to insert, store and retrieve Images
- reading environment variables from java using Eclipse
- How can I create a Java EE 7 application using eclipse and gradle?
- Why is this Java program gives incorrect results on Eclipse and correct results when run from terminal?
- java generics compiles in eclipse and not from commandline
- Using SWI-Prolog with Eclipse and Java (and JUNG): Should I use ProDT, PDT, or both?
- How to avoid no main class and no class def found error using DropBox and Eclipse for Java
- Using JNI to execute a java jar from a C++ program, using g++ or eclipse
- Mixed Modular and Non-Modular Development in Eclipse using Java 11
- How to get the current project path from eclipse using java
More Query from same tag
- Aobut PHP Description Resource Path Location Type syntax error, unexpected '<', expecting 'EOF' timer.php /LZtimer line 33 PHP Syntax Error
- How do I resolve an "Error reading signed content." error when installing ADT 23.0.2 in Eclipse 4.4 on OSX
- Show package explorer in PyDev Debug perspective
- Can't run service builder (liferay 6.2)
- Order of evaluation with relative layouts, best practices and parsing of relative-layout
- Maven project imported to eclipse from git is missing "Maven Dependencies" library
- Hiding cursor in Text component in Eclipse RCP application
- Can't import javax.servlet.annotation.WebServlet
- Eclipse automatic generate fingerprint sha1 for every android project?
- Strange behavior with error java.security.cert.CertificateParsingException
- Troubles with storing username/password
- how to export (JUnit) test suite as executable jar
- How do increase memory for the Ant 'Javadoc' task?
- How to save/display graphical representation of a Neural Network in a file in Java (Eclipse)?
- HttpHostConnectException when Validating Account in Creation of IBM Bluemix Server
- How to tell Eclipse what file to run in a PHP project?
- Application not opened in android
- Running Ruby debugger on Eclipse PDT
- an internal error occurred during: uploading code to lambda
- Creating game gravity in Android (continued)?
- Cloning Eclipse project from BitBucket causes unexpected code errors
- Method to iterating through classes in a package using Reflection
- NoClassDefFoundError on HelloWorld program
- Error in Eclipse Luna in m2e plugin when adding dependency to AspectJ
- How to add sonar in the antbuildfile in Eclipse
- Spring Field required a bean of type that could not be found Spring JPA
- how can install swing/matisse on eclipse?
- Eclipse headless build OutOfMemoryError
- Missing R.java file even though project cleaned
- Eclipse plug-in: Custom plugin.xml like editor