I won’t even pretend to understand the maths on this one, so lets just dive into the code, first we initialize our window:
With that we have a non resizable JFrame on the middle of the screen, that terminates the program when closed which contains a JPanel where we can draw, in order to do so we only need the Graphics from the JPanel:
Then we start shamelessly translating the Go code from the link above to Java:
Since its a single file, if we have Java 11 or above we can run it without compiling with:
And we should see this:
Download the complete code for this here: Lissajous.java.