<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with exit() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=exit%28%29</link>
      <pubDate>Sun, 08 Aug 2021 19:43:13 +0000</pubDate>
         <description>Tagged with exit() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedexit%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Terminate execution and close window</title>
      <link>https://forum.processing.org/two/discussion/25974/terminate-execution-and-close-window</link>
      <pubDate>Mon, 15 Jan 2018 15:48:54 +0000</pubDate>
      <dc:creator>chrisjj</dc:creator>
      <guid isPermaLink="false">25974@/two/discussions</guid>
      <description><![CDATA[<p>What language statement(s) will terminate execution and close the executable's window?</p>
]]></description>
   </item>
   <item>
      <title>why is my exit timer not working?</title>
      <link>https://forum.processing.org/two/discussion/25694/why-is-my-exit-timer-not-working</link>
      <pubDate>Sun, 24 Dec 2017 03:14:43 +0000</pubDate>
      <dc:creator>ctrembla</dc:creator>
      <guid isPermaLink="false">25694@/two/discussions</guid>
      <description><![CDATA[<p>I'm making a chrismas tree program, that when you hit esc a timer starts and a message appear on the screen before the game closes, but when I press the button the game automatically ends without the timer.</p>

<p><a href="https://paste.ofcode.org/UqmfvSGJ6Z3DrVWaAhC2Av" target="_blank" rel="nofollow">https://paste.ofcode.org/UqmfvSGJ6Z3DrVWaAhC2Av</a></p>

<p>I want to display stuff right before the game closes.</p>
]]></description>
   </item>
   <item>
      <title>exit function - newbie need help</title>
      <link>https://forum.processing.org/two/discussion/25577/exit-function-newbie-need-help</link>
      <pubDate>Fri, 15 Dec 2017 12:37:57 +0000</pubDate>
      <dc:creator>mrNebu</dc:creator>
      <guid isPermaLink="false">25577@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>im new to programming and picked up processing yesterday. i can draw simple stuff etc.</p>

<p>now i wanted to make the following, a simple black fullscreen and when pressing the esc key the program stops/exits.</p>

<p>the blackscreen is working but i cant seem to get the exit stuff to work can someone please tell me what im doing wrong here?</p>

<pre><code>    void setup() { 
      fullScreen();
      stroke(0);
      fill(0);
      rect(0, 0, 2560, 1440);
    } 

    void keyPressed() {
      if (key==ESC) {
        key=0;
        exit();
          }
    }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Help figuring out error when using Video library</title>
      <link>https://forum.processing.org/two/discussion/25428/help-figuring-out-error-when-using-video-library</link>
      <pubDate>Wed, 06 Dec 2017 22:35:41 +0000</pubDate>
      <dc:creator>NewTimer</dc:creator>
      <guid isPermaLink="false">25428@/two/discussions</guid>
      <description><![CDATA[<p>This is my code that is currently used to cycle through 3 different videos by pressing Q:</p>

<pre><code>import processing.video.*;
static final int movieCount = 3;
final Movie[] myMovie = new Movie[movieCount];
int index;
int maxMovieIndex = movieCount-1;

void setup() {
  size(1920, 1080);
  myMovie[0] = new Movie(this, "scene_0.mp4");
  myMovie[1] = new Movie(this, "scene_1.mp4");
  myMovie[2] = new Movie(this, "scene_2.mp4");
  myMovie[0].loop();
}

void draw() {
  set(0, 0, myMovie[index]);
  image(myMovie[index], 0, 0);

  println("index: " + index);
}

void keyPressed()
{
 if (key == 'q')
 {
   myMovie[index].pause();
   if (index != maxMovieIndex)
   {
    index++; 
   }
   else
   {
    index = 0; 
   }
   myMovie[index].loop();
 }
}

void movieEvent(Movie m) {
  m.read();
}
</code></pre>

<p>It runs, but if I exit after doing a switch, I get an error in the console upon exit:</p>

<blockquote class="Quote">
  <p>(java.exe:6620): GStreamer-CRITICAL **: 
  Trying to dispose element Movie Player, but it is in PAUSED instead of the NULL state.
  You need to explicitly set elements to the NULL state before
  dropping the final reference, to allow them to clean up.
  This problem may also be caused by a refcounting bug in the
  application or some element.</p>
  
  <p>(java.exe:6620): GStreamer-CRITICAL **: 
  Trying to dispose element inputselector0, but it is in PAUSED instead of the NULL state.
  You need to explicitly set elements to the NULL state before
  dropping the final reference, to allow them to clean up.
  This problem may also be caused by a refcounting bug in the
  application or some element.</p>
</blockquote>

<p>What does this mean, and how do I fix it? I guess it has to do with how the Movie object is used, but I haven't seen examples in the documentation on why/how to safely exit.</p>
]]></description>
   </item>
   <item>
      <title>Alternative to exit() in androidMode 4.0.</title>
      <link>https://forum.processing.org/two/discussion/24019/alternative-to-exit-in-androidmode-4-0</link>
      <pubDate>Mon, 04 Sep 2017 11:04:10 +0000</pubDate>
      <dc:creator>S4NN4S</dc:creator>
      <guid isPermaLink="false">24019@/two/discussions</guid>
      <description><![CDATA[<p>I have updated to the lastest androidMode version, which is supposed to be compatible with Processing 3.1+.</p>

<p>The problem occurs every time I want to run a sketch that uses exit(). This is the error I am being shown:</p>

<pre><code>1. ERROR in C:\Users\xxs4n\AppData\Local\Temp\android8325461978585377780sketch\app\src\main\java\processing\test\xd_1_1_2\xD_1_1_2.java (at line 225)
    exit();
    ^^^^
The method exit() is undefined for the type xD_1_1_2.gameManager
----------
1 problem (1 error)
 FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\xxs4n\AppData\Local\Temp\android8325461978585377780sketch\app\build.gradle' line: 62

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
&gt; Process 'command 'C:\Program Files (x86)\processing-3.3.5-windows64\java\bin\java.exe'' finished with non-zero exit value -1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 6s
26 actionable tasks: 26 executed
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution '<a href="https://services.gradle.org/distributions/gradle-4.0-bin.zip'" target="_blank" rel="nofollow">https://services.gradle.org/distributions/gradle-4.0-bin.zip'</a>.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:748)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:77)
    at processing.mode.android.AndroidBuild.gradleBuild(AndroidBuild.java:265)
    at processing.mode.android.AndroidBuild.build(AndroidBuild.java:201)
    at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:315)
    at processing.mode.android.AndroidEditor$15.run(AndroidEditor.java:373)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file 'C:\Users\xxs4n\AppData\Local\Temp\android8325461978585377780sketch\app\build.gradle' line: 62
Execution failed for task ':app:compileDebugJavaWithJavac'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$1.run(DefaultGradleLauncher.java:124)
    at org.gradle.internal.work.DefaultWorkerLeaseService$2.execute(DefaultWorkerLeaseService.java:124)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:116)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:99)
    at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:50)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:242)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:235)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:224)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:121)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:102)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:96)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:612)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:567)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:96)
    ... 3 more
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\processing-3.3.5-windows64\java\bin\java.exe'' finished with non-zero exit value -1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:370)
    at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
    at org.gradle.api.internal.file.DefaultFileOperations.javaexec(DefaultFileOperations.java:176)
    at org.gradle.api.internal.project.DefaultProject.javaexec(DefaultProject.java:1061)
    at org.gradle.groovy.scripts.DefaultScript.javaexec(DefaultScript.java:235)
    at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479)
    at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
    at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:130)
    at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80)
    at org.gradle.internal.metaobject.BeanDynamicObject$GroovyObjectAdapter.invokeOpaqueMethod(BeanDynamicObject.java:579)
    at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:506)
    at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
    at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80)
    at build_eafr1p7ebkiyrqiay1hjyj7bq$_run_closure1$_closure5$_closure8.doCall(C:\Users\xxs4n\AppData\Local\Temp\android8325461978585377780sketch\app\build.gradle:62)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:670)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:651)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 27 more
</code></pre>

<p>Is there another function I must use in order to stop an app?</p>
]]></description>
   </item>
   <item>
      <title>How to exit fullScreen</title>
      <link>https://forum.processing.org/two/discussion/23819/how-to-exit-fullscreen</link>
      <pubDate>Tue, 15 Aug 2017 13:00:35 +0000</pubDate>
      <dc:creator>bloomboy</dc:creator>
      <guid isPermaLink="false">23819@/two/discussions</guid>
      <description><![CDATA[<p>I have searched the examples and tutorials, and finding it difficult to locate a fix for this,
At present I have a patch that runs successfully and opens fullscreen - When I press escape to exit the patch quits unexpectedly with the issue 'Could not run the sketch (Target VM failed to initialize).'</p>

<p>What am i missing out here?
Can I create a keypress to exit fullScreen and cut out this error?</p>

<pre><code> void setup() {



  fullScreen(P3D);

  PJOGL.profile=1;
    surface.setResizable(true);
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to call a function on processing crash?</title>
      <link>https://forum.processing.org/two/discussion/23357/how-to-call-a-function-on-processing-crash</link>
      <pubDate>Fri, 07 Jul 2017 18:32:52 +0000</pubDate>
      <dc:creator>VladShev</dc:creator>
      <guid isPermaLink="false">23357@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to write a function that would be called if my processing sketch has crashed. I managed to make it so that the function is called if the program is exited intentionally like so:</p>

<pre><code>    @ Override void exit() {
      //my code here
      super.exit();
    }
</code></pre>

<p>But this, of course, is not called during a crash (I'm just trying to save the traceback to a file). Is there a way to do so without dozens of 'try' statements in my code?</p>

<p>Thanks in advance!!</p>
]]></description>
   </item>
   <item>
      <title>(Solved) Javaw process wont close after the exit of my program (Eclipse)</title>
      <link>https://forum.processing.org/two/discussion/22292/solved-javaw-process-wont-close-after-the-exit-of-my-program-eclipse</link>
      <pubDate>Sat, 29 Apr 2017 23:21:41 +0000</pubDate>
      <dc:creator>TPRammus</dc:creator>
      <guid isPermaLink="false">22292@/two/discussions</guid>
      <description><![CDATA[<p>So I am using Processing via Eclipse and the processes just wont close after the exit of my program.
I noticed it after my computer startet to get really slow and I opened the task manager and yay 10 javaw processes!
When I use the Processing editor however, it does close the processes normally.</p>

<p>regards, TPRammus</p>
]]></description>
   </item>
   <item>
      <title>Exit sketch but preserve parent process</title>
      <link>https://forum.processing.org/two/discussion/13467/exit-sketch-but-preserve-parent-process</link>
      <pubDate>Tue, 10 Nov 2015 11:54:38 +0000</pubDate>
      <dc:creator>munkey</dc:creator>
      <guid isPermaLink="false">13467@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
Im new to processing and I have just got started using it with java. At the minute I have a java swing application which spawns a separate sketch window using PApplet.runSketch(). When the window is closed either by pressing escape, pressing the X or calling .exit() on the PApplet, the entire program including the swing main program closes with it.</p>

<p>Is there a way I can make it so when sketch is closed it does not kill off my entire program and just closes the sketch window?</p>

<p>Thanks.</p>
]]></description>
   </item>
   <item>
      <title>Remove processing-java window</title>
      <link>https://forum.processing.org/two/discussion/20798/remove-processing-java-window</link>
      <pubDate>Tue, 14 Feb 2017 17:42:49 +0000</pubDate>
      <dc:creator>usernamevalid</dc:creator>
      <guid isPermaLink="false">20798@/two/discussions</guid>
      <description><![CDATA[<p>Im running processing-java from cmd line in another app. The app creates an image in an offscreen buffer, saves it and exits. 
However when ever the app is called there is still a window that pops up on screen, it takes focus away anything on screen. Is there a way to run processing-java with no window?</p>

<p>Thanks</p>
]]></description>
   </item>
   <item>
      <title>How To Create "Game Over"</title>
      <link>https://forum.processing.org/two/discussion/19380/how-to-create-game-over</link>
      <pubDate>Tue, 29 Nov 2016 04:46:13 +0000</pubDate>
      <dc:creator>lbrez16</dc:creator>
      <guid isPermaLink="false">19380@/two/discussions</guid>
      <description><![CDATA[<p>Hello! So I am creating a game similar to a snake game but with one individual shape moving instead of getting bigger. The issue with my code that I'm having is that when the icon hits the wall I can't figure out how to get it to be a full on Game Over where you have to press a button to restart the game. Below I have posted my code so any help that can be given is greatly appreciated!!</p>

<pre><code>Logo l;
int grid = 35;
PImage BH;
PImage SC;
PImage Rink;

PVector Cup;


void setup() {

  size(800, 422);
  l = new Logo();
  frameRate(8);
  pickLocation();
  BH = loadImage("BH.png");
  SC = loadImage("SC.png");
  Rink = loadImage("Rink.jpg");

}

void pickLocation() {
  int across = width/grid;
  int down = height/grid;
  Cup = new PVector(floor(random(across)), floor(random(down)));
  Cup.mult(grid);
}

void draw() {
  background(Rink);

  if (l.capture(Cup)) {
    pickLocation();
  }
  l.death();
  l.update();
  l.show();

  image(SC,Cup.x, Cup.y, grid, grid);
}

void keyPressed() {
  if (keyCode == UP) {
    l.dir(0, -1);
  } else if (keyCode == DOWN) {
    l.dir(0, 1);
  } else if (keyCode == RIGHT) {
    l.dir(1, 0);
  } else if (keyCode == LEFT) {
    l.dir(-1, 0);
  }
}
</code></pre>

<hr />

<p>Logo.pde</p>

<pre><code>class Logo {
  float x = 0;
  float y = 0;
  float xspeed = 1;
  float yspeed = 0;
  int total = 0;
  ArrayList&lt;PVector&gt; tail = new ArrayList&lt;PVector&gt;();

  Logo() {
  }

  boolean capture(PVector pos) {
    float d = dist(x, y, pos.x, pos.y);
    if (d &lt; 1) {
      return true;
    } else {
      return false;
    }
  }

  void dir(float x, float y) {
    xspeed = x;
    yspeed = y;
  }

  void death() {
    for (int i = 0; i &lt; tail.size(); i++) {
      PVector pos = tail.get(i);
      float d = dist(x, y, pos.x, pos.y);
      if (d &lt; 1) {
        println("starting over");
        total = 0;
        tail.clear();
      }
    }
  }

  void update() {
    if (total &gt; 0) {
      if (total == tail.size() &amp;&amp; !tail.isEmpty()) {
        tail.remove(0);
      }
      tail.add(new PVector(x, y));
    }

    x = x + xspeed*grid;
    y = y + yspeed*grid;

    x = constrain(x, 0, width-grid);
    y = constrain(y, 0, height-grid);
  }

  void show() {
    fill(255);
    for (PVector v : tail) {
      rect(v.x, v.y, grid, grid);
    }
    image(BH, x, y, grid, grid);
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Show running time at the end of process</title>
      <link>https://forum.processing.org/two/discussion/18073/show-running-time-at-the-end-of-process</link>
      <pubDate>Mon, 05 Sep 2016 01:38:41 +0000</pubDate>
      <dc:creator>siminan87</dc:creator>
      <guid isPermaLink="false">18073@/two/discussions</guid>
      <description><![CDATA[<p>Hi guys I need some help. I want to display the time an application has been running for at the end of a process how do I do this. Thank you in advance.</p>
]]></description>
   </item>
   <item>
      <title>How to correctly exit a Processing sketch in Android</title>
      <link>https://forum.processing.org/two/discussion/18230/how-to-correctly-exit-a-processing-sketch-in-android</link>
      <pubDate>Wed, 21 Sep 2016 13:57:38 +0000</pubDate>
      <dc:creator>SAFR</dc:creator>
      <guid isPermaLink="false">18230@/two/discussions</guid>
      <description><![CDATA[<p>I am currently building an app in Android Studio involving a Processing sketch.</p>

<p>Main class:</p>

<pre><code>    import android.app.Activity;
    import android.app.FragmentManager;
    import android.os.Bundle;

    import processing.android.PFragment;
    import processing.core.PApplet;

    public class ClassMain extends Activity {
        /**************************************************/
        PApplet sketch;
        /**************************************************/
        <a href="/two/profile/Override">@Override</a>
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.class_main);

            FragmentManager fragmentManager = getFragmentManager();
            sketch = new ClassSketch();
            PFragment fragment = new PFragment();
            fragment.setSketch(sketch);
            fragmentManager.beginTransaction().replace(R.id.container, fragment).commit();
        }
        /**************************************************/
        <a href="/two/profile/Override">@Override</a>
        public void onBackPressed()
        {

            //ClassMain.this.finish();
        }
        /**************************************************/
        //It doesn't work if called from sketch...
        public void exits()
        {
            ClassMain.this.finish();
        }
        /**************************************************/
    }
</code></pre>

<p>Processing Sketch:</p>

<pre><code>    import android.view.KeyEvent;
    import processing.core.PApplet;

    public class ClassSketch extends PApplet {
        /*****************************************************************************/
        public void settings()
        {
            size(displayWidth, displayHeight);
        }
        /*****************************************************************************/
        public void setup()
        {
        }
        /*****************************************************************************/
        public void draw()
        {
            keykey();
        }
        public void keykey()
        {
            if(keyPressed)
            {
                if (key == CODED) {
                    if (keyCode == KeyEvent.KEYCODE_BACK) {
                        //non of the following work:
                        //exit();
                        ClassMain j = new ClassMain();
                        j.exits();
                    }
                }
            }
        }
    }
</code></pre>

<p>Here is the problem, I want the the user, depending on some circumstances that I will add later in the sketch, to exit not only the sketch but the class that is hosting it  (<code>ClassMain</code>). 
When ever (in the sketch) something happens in my sketch, I want to be able to exit the whole <code>MainClass</code>, but I just happen to fail.
Thanks for the support.</p>
]]></description>
   </item>
   <item>
      <title>Run code on exit (follow-up)</title>
      <link>https://forum.processing.org/two/discussion/579/run-code-on-exit-follow-up</link>
      <pubDate>Tue, 22 Oct 2013 05:03:35 +0000</pubDate>
      <dc:creator>sableRaph</dc:creator>
      <guid isPermaLink="false">579@/two/discussions</guid>
      <description><![CDATA[<p>This is a follow-up of the thread: <a href="http://forum.processing.org/one/topic/run-code-on-exit.html" target="_blank" rel="nofollow">http://forum.processing.org/one/topic/run-code-on-exit.html</a></p>

<p>The recommended method for running some code when closing the sketch used to be registering a dispose handler. However, it looks like the registerDispose() method from PApplet is deprecated (see <a rel="nofollow" href="http://processing.org/reference/javadoc/core/processing/core/PApplet.html#unregisterDispose(java.lang.Object)">Javadoc</a>)</p>

<p>The following code still works but is there a recommended alternative to the registerDispose() method?</p>

<pre><code>public class DisposeHandler {

DisposeHandler(PApplet pa)
{
  pa.registerDispose(this);
}

public void dispose()
{      
  println("Closing sketch");
}

}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to make processing full screen and close processing?</title>
      <link>https://forum.processing.org/two/discussion/14065/how-to-make-processing-full-screen-and-close-processing</link>
      <pubDate>Fri, 18 Dec 2015 15:12:31 +0000</pubDate>
      <dc:creator>Phonicz</dc:creator>
      <guid isPermaLink="false">14065@/two/discussions</guid>
      <description><![CDATA[<p>Is there any way to make processing 3.0 full screen?</p>

<p>Also is there any way to make a close button to close it?</p>
]]></description>
   </item>
   <item>
      <title>Minim pause() does not work</title>
      <link>https://forum.processing.org/two/discussion/16413/minim-pause-does-not-work</link>
      <pubDate>Tue, 03 May 2016 20:37:44 +0000</pubDate>
      <dc:creator>pet0103</dc:creator>
      <guid isPermaLink="false">16413@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I am working on a tangible music player with Arduino and for this I am using the minim library. However, the player.pause() function does not work in my code. It only stops the song for a few milliseconds and then continues to play the song.</p>

<p>The code for the pause function is as the following:</p>

<pre lang="javascript">
    boolean state = false;
    
    if (keyPressed) {
        if (key == 'p' &amp;&amp; !state) {
          state = true;
          player[currentSong].pause();
        }
        else if (key == 'p' &amp;&amp; state) {
        state = false;
        player[currentSong].play();
      }
</pre>

<p>Is there something else that I have to add in order to let it pause until I press the P key again?</p>
]]></description>
   </item>
   <item>
      <title>Don't close Processing when ESC key is pressed.</title>
      <link>https://forum.processing.org/two/discussion/15781/don-t-close-processing-when-esc-key-is-pressed</link>
      <pubDate>Thu, 31 Mar 2016 11:07:10 +0000</pubDate>
      <dc:creator>Zirk</dc:creator>
      <guid isPermaLink="false">15781@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I found some lines to prevent Processing to close when I press the escape key:</p>

<p>if(keyCode == ESC)
    key = 0;</p>

<p>It worked some days ago but now... it's not working anymore...
I tried with a old version of my code, and it worked.
I can't copy all my code here, because it would take too much place.</p>

<p>Thanks in advance.</p>
]]></description>
   </item>
   <item>
      <title>handle a big and dynamic array / event when closing the program ?</title>
      <link>https://forum.processing.org/two/discussion/15354/handle-a-big-and-dynamic-array-event-when-closing-the-program</link>
      <pubDate>Mon, 07 Mar 2016 23:23:02 +0000</pubDate>
      <dc:creator>LorenzoFR</dc:creator>
      <guid isPermaLink="false">15354@/two/discussions</guid>
      <description><![CDATA[<p>hello,</p>

<p>i'm new in processing, just discover this interesting world and starting to do stuff with it ...<br />
i know web language (as/php/js/...) and a little (very little) C/C++/C# and delphi.</p>

<p>this is the project i have done so far  :</p>

<ul>
<li>i read the serial data received from an arduino (temperature) (conversion string to float)  </li>
<li>every second i create an average temperature with the last data and add a plot on a graph  </li>
<li>when the graph is full, i save all the data to a file and start a new graph  </li>
</ul>

<p>this is a visual :<br />
<img src="http://complet1.free.fr/_divers/forum/07-03-16/exemple_stats.png" alt="" /></p>

<p>problem<strong>s</strong> :</p>

<ul>
<li>handling a big "dynamic" float array (so far i use a <strong>Table</strong>) (1 hour = 3600 float / 24 hours = 86400 float)</li>
<li>saving all the data to a file when the program is closing</li>
</ul>

<p>question<strong>s</strong> :</p>

<ul>
<li>i don't know how many data i have to store and the array or arrayList can't handle dynamic array ... what's the best data type for this project ?</li>
<li>can't find an event to trigger when the program is closing, please tell me there is one !??</li>
</ul>

<p>thank's</p>
]]></description>
   </item>
   <item>
      <title>How to close one window without closing the entire program?</title>
      <link>https://forum.processing.org/two/discussion/14367/how-to-close-one-window-without-closing-the-entire-program</link>
      <pubDate>Sat, 09 Jan 2016 23:10:40 +0000</pubDate>
      <dc:creator>digitalblueeye</dc:creator>
      <guid isPermaLink="false">14367@/two/discussions</guid>
      <description><![CDATA[<p>Hey guys! I was wondering if i could get some help. I am trying to setup a program of mine that has two windows. the problem is that when one window is closed, it kills the whole program. I am using the FX2D Renderer, here is my code:</p>

<p>Window 2:</p>

<pre><code>import processing.core.*;

public class AssetManager extends PApplet {

    public void run() {
        PApplet.main(new String[] {"AssetManager"});
    }

    public ArrayList&lt;File&gt; assets;  
    public String[] assetThumbs;    
    public String[] fontList = PFont.list();


    public void settings() {
        size(600,400,FX2D);
    }

    public void setup() {

    }

    public void draw() {

    }
</code></pre>

<p>Main Program (includes the void main) and Window one:</p>

<p>Basically the same, just declares the class constructor and launches the secondary window using void run.
This works totally fine for running two windows from one program, I just need to figure out how to set up the individual closing/exit setup.</p>

<p>Thank you!!!!</p>
]]></description>
   </item>
   <item>
      <title>Processing and garbage collection ?</title>
      <link>https://forum.processing.org/two/discussion/13671/processing-and-garbage-collection</link>
      <pubDate>Thu, 26 Nov 2015 18:38:23 +0000</pubDate>
      <dc:creator>pxgator</dc:creator>
      <guid isPermaLink="false">13671@/two/discussions</guid>
      <description><![CDATA[<p>I'm using a Raspberry Pi 2 with the raspbian jessie image. Processing and the G4P lib and gui builder are working very well but when I close a window by clicking the 'x' the task manager still shows a java thread and a thread with the name of the sketch still running. The java thread is also still consuming some CPU time. So, by using the exit() function what code should I be using to do a complete 'clean up' ??</p>
]]></description>
   </item>
   <item>
      <title>How to do delay(), exit() in P5?</title>
      <link>https://forum.processing.org/two/discussion/13608/how-to-do-delay-exit-in-p5</link>
      <pubDate>Mon, 23 Nov 2015 06:55:24 +0000</pubDate>
      <dc:creator>kennyLiao</dc:creator>
      <guid isPermaLink="false">13608@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone,</p>

<p>in P3, we have <code>delay()</code> and <code>exit()</code>, but didn't find anything similar in p5js reference. What can I do to get the equivalent functions?</p>

<p>Thanks!</p>
]]></description>
   </item>
   <item>
      <title>G4P main window close event</title>
      <link>https://forum.processing.org/two/discussion/13653/g4p-main-window-close-event</link>
      <pubDate>Wed, 25 Nov 2015 17:13:26 +0000</pubDate>
      <dc:creator>pxgator</dc:creator>
      <guid isPermaLink="false">13653@/two/discussions</guid>
      <description><![CDATA[<p>Is there a simple example on how to run code when the G4P 
main window is closing ?</p>
]]></description>
   </item>
   <item>
      <title>Closing Detection OR making it so you can't close window</title>
      <link>https://forum.processing.org/two/discussion/13617/closing-detection-or-making-it-so-you-can-t-close-window</link>
      <pubDate>Mon, 23 Nov 2015 21:16:52 +0000</pubDate>
      <dc:creator>SlimeEnergy</dc:creator>
      <guid isPermaLink="false">13617@/two/discussions</guid>
      <description><![CDATA[<p>I have 2 questions. ! &lt;- will determine their priority................................................................................................................
!!! How do you make it so you can't close a game with the big X button. I want it to close if you clicked into a menu. I know the exit() thing and I need that so I can save the game with a print writer. That will be part of the other question, but how do I make it so you can't close a game with the [X] button on the top right of the window?...................................................................................................................................................................................</p>

<p>!! How do I detect if the window was closed? Like if you pressed the big [X] button.</p>
]]></description>
   </item>
   <item>
      <title>Run code on exit on processing 3</title>
      <link>https://forum.processing.org/two/discussion/13593/run-code-on-exit-on-processing-3</link>
      <pubDate>Sat, 21 Nov 2015 21:00:14 +0000</pubDate>
      <dc:creator>cladelpino</dc:creator>
      <guid isPermaLink="false">13593@/two/discussions</guid>
      <description><![CDATA[<p>Hi all, is the solution proposed in <a rel="nofollow" href="https://forum.processing.org/two/discussion/579/run-code-on-exit-follow-up">this </a>thread still true for processing 3 ?</p>

<p>regards and thanks
Claudio</p>
]]></description>
   </item>
   <item>
      <title>Opening a new window and closing the main one</title>
      <link>https://forum.processing.org/two/discussion/12328/opening-a-new-window-and-closing-the-main-one</link>
      <pubDate>Tue, 01 Sep 2015 01:00:09 +0000</pubDate>
      <dc:creator>rtavakko</dc:creator>
      <guid isPermaLink="false">12328@/two/discussions</guid>
      <description><![CDATA[<p>Hey peeps,</p>

<p>I'm trying to make a user interface with controlp5. The idea is that when the user presses a button, the main sketch with the controls closes and a new window opens with the main show. I know how to open a new applet using JFrame, but I can't seem to close the original window without the second one also closing (been using exit() so far).</p>

<p>Any ideas?!</p>

<p>Cheers!!!</p>
]]></description>
   </item>
   <item>
      <title>Running exit() from settings() causes NullPointerException</title>
      <link>https://forum.processing.org/two/discussion/12210/running-exit-from-settings-causes-nullpointerexception</link>
      <pubDate>Sat, 22 Aug 2015 21:39:47 +0000</pubDate>
      <dc:creator>ryansheets15</dc:creator>
      <guid isPermaLink="false">12210@/two/discussions</guid>
      <description><![CDATA[<p>Any time I try to call exit() from settings(), it will cause a NullPointerException. It will work fine if I call it from anywhere else. Any idea of why? or how to fix it?</p>
]]></description>
   </item>
   <item>
      <title>Window closing action</title>
      <link>https://forum.processing.org/two/discussion/12253/window-closing-action</link>
      <pubDate>Tue, 25 Aug 2015 21:59:11 +0000</pubDate>
      <dc:creator>Mino32</dc:creator>
      <guid isPermaLink="false">12253@/two/discussions</guid>
      <description><![CDATA[<p>Hi guys!!</p>

<p>How can i put an action when the window closes (all the program closes). For example, to save an image of the sketch when I close my program. Is there an event or something?</p>

<p>Thanks :)</p>
]]></description>
   </item>
   <item>
      <title>running code on exit; again</title>
      <link>https://forum.processing.org/two/discussion/11648/running-code-on-exit-again</link>
      <pubDate>Fri, 10 Jul 2015 22:45:24 +0000</pubDate>
      <dc:creator>ondsinet_</dc:creator>
      <guid isPermaLink="false">11648@/two/discussions</guid>
      <description><![CDATA[<p>After reading many posts on this and on the old processing forums I've tried to compare the ways of running code on exit; but I've found no difference between registering a dispose handler as it is often suggested or overriding the exit() function;</p>

<p>meaning that</p>

<pre><code>void exit() {
  println("closing");
    super.exit();
  }
</code></pre>

<p>will be called every time the program is closed(via program,clicking on the red X,task manager...)except when closing from the processing ide.
Actually by removing the call to super.exit() the code can be runned in background while looking close(SO vulnerability?).
So wich one is better?</p>
]]></description>
   </item>
   <item>
      <title>How to make the close button do nothing?</title>
      <link>https://forum.processing.org/two/discussion/11276/how-to-make-the-close-button-do-nothing</link>
      <pubDate>Thu, 11 Jun 2015 23:50:37 +0000</pubDate>
      <dc:creator>Cynos</dc:creator>
      <guid isPermaLink="false">11276@/two/discussions</guid>
      <description><![CDATA[<p>I want to make the "game" I'm working on do nothing on close. I mean, if you want to exit using the close button, it will make nothing until you can press a certain button in it.</p>
]]></description>
   </item>
   <item>
      <title>Is there a way to make Processing 'printLn' as soon as the user quits the program?</title>
      <link>https://forum.processing.org/two/discussion/10395/is-there-a-way-to-make-processing-println-as-soon-as-the-user-quits-the-program</link>
      <pubDate>Sat, 18 Apr 2015 23:31:28 +0000</pubDate>
      <dc:creator>nfeldbaum</dc:creator>
      <guid isPermaLink="false">10395@/two/discussions</guid>
      <description><![CDATA[<p>.</p>
]]></description>
   </item>
   </channel>
</rss>