# Cannot call circle() in seperate java file

**URL:** <https://discourse.processing.org/t/cannot-call-circle-in-seperate-java-file/22439>\
**Category:** Coding Questions\
**Created:** [July 7, 2020, 6:07am UTC](https://discourse.processing.org/t/cannot-call-circle-in-seperate-java-file/22439 "2020-07-07T06:07:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ackados](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ackados/32/8282_2.png) [@Ackados](https://discourse.processing.org/u/Ackados)\
**Post date:** [July 7, 2020, 6:07am UTC](https://discourse.processing.org/t/cannot-call-circle-in-seperate-java-file/22439/1 "2020-07-07T06:07:04Z")

</div>

I got my sketch.java file, and I can call `circle(100, 100, 10);` just fine in there. However, when I go to my Particle.java, I call `circle(100, 100, 10);`, I get errors.

First, this is my import: `import processing.core.*;` This does not work, I must extend my class to PApplet.  
I extend it, but why do I need to extend it, when in sketch.java already extends it and runs the main app?

I extended it anyway, and I was allowed to use `circle(100, 100, 10);`, but when I compiled and ran it, I got an error:

```auto
java.lang.NullPointerException
	at processing.core.PApplet.circle(PApplet.java:12300)

```

So I am really confused why I can’t call circle() in another class. How am I supposed to be doing it?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 7, 2020, 6:17am UTC](https://discourse.processing.org/t/cannot-call-circle-in-seperate-java-file/22439/2 "2020-07-07T06:17:40Z")

</div>

> [@Ackados](#):
>
> However, when I go to my Particle.java, I call `circle(100, 100, 10);` , I get errors.

> [@keyPressed and keyReleased with java(eclipse)](https://discourse.processing.org/t/keypressed-and-keyreleased-with-java-eclipse/12994/5):
>
> Oopsie! Just now I’ve noticed the end of your thread title better: “Java (Eclipse)”! woozy_face When using Eclipse and other similar IDEs, we need to use real Java syntax in files w/ “.java” extension. coffee Processing’s IDE (PDE) uses “.pde” files. Although it recognizes “.java” files too. innocent If you wanna, I can convert the class Player to actual Java syntax inside file “Player.java”. nerd_face But b/c I don’t have Eclipse, I won’t be able to test if it’s actually compilable …
