Actually, I am learning Java myself. I am LEARNING, lol. What you need is an applet. You will also need a Java compiler to make the changes to your code. To make your script an applet, you will need to make many changes. Applets are much more complicated than regular Java applications. I would HIGHLY suggest you get someone who knows Java to change it for you. If your script is simple, you might be able to change it to an applet by putting:
To write the text you would need to use the g.drawString functions and paint(), etc. I am no expert, and what I told you might not work, so before changing it, copy it incase something bad happens to it when you make the changes. I wouldn't try it if I didn't no the basics of Java.