# Processing Java file into HTML

**URL:** <https://discourse.processing.org/t/processing-java-file-into-html/42123>\
**Category:** Beginners\
**Created:** [June 2, 2023, 12:40pm UTC](https://discourse.processing.org/t/processing-java-file-into-html/42123 "2023-06-02T12:40:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [June 2, 2023, 10:43pm UTC](https://discourse.processing.org/t/processing-java-file-into-html/42123/2 "2023-06-02T22:43:16Z")

</div>

> [@rrnn](#):
>
> But is it possible to use a sketch made with Java in Processing app into a html page?

As long as it sticks to [Processing’s API](https://gotoloop.github.io/processing-js.github.io/reference/), project [Pjs](https://gotoloop.github.io/processing-js.github.io/) can auto-transpile Java to JS syntax: ☕

> [@Help with simple game (moving fish)](https://discourse.processing.org/t/help-with-simple-game-moving-fish/40679/9):
>
> You pick another value for nextFrameChange only after frameCount reached current nextFrameChange: if (frameCount \>= nextFrameChange) swapDirection(); It’s inside funtion swapDirection() that you change nextFrameChange: void swapDirection() { speed \*= -1; nextFrameChange = frameCount + 60 \* (int) random(5, 11); // 5s to 10s range } Anyways, I did a demo sketch that has a class Fish w/ methods such as display(), update(), bounce(), touchedBoundary(), etc.: Swimming\_Fish.pde /\*\* \* Swim…

Another online sketch demo: 🐙

> **[GitHub - GoSubRoutine/Grumbo](https://github.com/GoSubRoutine/Grumbo)**
>
> Contribute to GoSubRoutine/Grumbo development by creating an account on GitHub.

---

_[View the full topic](https://discourse.processing.org/t/processing-java-file-into-html/42123)._
