# Tester for the PAppletFinder in Processing 4 required

**URL:** <https://discourse.processing.org/t/tester-for-the-pappletfinder-in-processing-4-required/38914>\
**Category:** Gallery\
**Created:** [September 21, 2022, 2:08pm UTC](https://discourse.processing.org/t/tester-for-the-pappletfinder-in-processing-4-required/38914 "2022-09-21T14:08:37Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Post date:** [September 25, 2022, 3:35pm UTC](https://discourse.processing.org/t/tester-for-the-pappletfinder-in-processing-4-required/38914/5 "2022-09-25T15:35:41Z")

</div>

> [@Get the current instance of PApplet from a library](https://discourse.processing.org/t/get-the-current-instance-of-papplet-from-a-library/36925/27):
>
> This code might do the trick. It also works with processing 3 and this code is able to breach encapsulation. (As long as there is no SecurityManager in place) PAppletFinder.java import processing.awt.\*; import processing.opengl.\*; import processing.core.\*; import javax.swing.\*; import java.awt.\*; import java.util.\*; import java.lang.reflect.\*; import sun.misc.\*; /\*\*This class finds the active PApplet (Processing program)\*/ public class PAppletFinder { /\*\*Unsafe instance used\*/ public sta…

---

_[View the full topic](https://discourse.processing.org/t/tester-for-the-pappletfinder-in-processing-4-required/38914)._
