# How can use this java file inside processing sketch

**URL:** <https://discourse.processing.org/t/how-can-use-this-java-file-inside-processing-sketch/2001>\
**Category:** Processing\
**Created:** [July 23, 2018, 7:16am UTC](https://discourse.processing.org/t/how-can-use-this-java-file-inside-processing-sketch/2001 "2018-07-23T07:16:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![basher24](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@basher24](https://discourse.processing.org/u/basher24)\
**Post date:** [July 23, 2018, 7:16am UTC](https://discourse.processing.org/t/how-can-use-this-java-file-inside-processing-sketch/2001/1 "2018-07-23T07:16:27Z")

</div>

how can i call the startup() function from processing sketch ?

/\*

- LiveRecognitionApp.java  
\*/

package liverecognition;

import org.jdesktop.application.Application;  
import org.jdesktop.application.SingleFrameApplication;  
import java.awt.event.\*;

/\*\*

- The main class of the application.  
\*/  
public class LiveRecognitionApp extends SingleFrameApplication {

---

<div class="post-metadata">

**Author:** ![Trilobyte](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/trilobyte/32/361_2.png) [@Trilobyte](https://discourse.processing.org/u/Trilobyte)\
**Post date:** [July 23, 2018, 7:37pm UTC](https://discourse.processing.org/t/how-can-use-this-java-file-inside-processing-sketch/2001/2 "2018-07-23T19:37:29Z")

</div>

Hi Basher,  
I would use the \</\> button to format your code correctly on the forum. That way, we can see what is actually commented out and such.

- Trilobyte

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [July 24, 2018, 3:32am UTC](https://discourse.processing.org/t/how-can-use-this-java-file-inside-processing-sketch/2001/3 "2018-07-24T03:32:04Z")

</div>

What does this class do? If this is generating some gui interface, then I am not sure if you can use it in Processing sketch. Processing has a PApplet instance that is managing the window and drawing resources for you. Not sure how easy is to hook an object of your class to the Processing engine. You will need to dig under the hood aka. check the source code available in github. However, doing this just breaks the basic goal of a Processing app which is to keep your apps simple as the PApplet is doing all the heavy lifting for you.

Kf
