Hi,
Welcome to JavaRanch!
Please don't post the same question to more than one forum. See
here for an explanation of why I just deleted the other copies of this
thread.
JApplet works differently from the old-fashioned Applet class, and in particular, it's not really intended to have its paint() method overridden. If you need to do graphics, you're supposed to do the graphics on a JPanel, and add the JPanel to the JApplet's root pane.
My recommendation is just to use java.applet.Applet instead of javax.swing.JApplet to write this kind of code. If you really want to use JApplet, then subclass JPanel, do the graphics in the paintComponent() method of the JPanel (calling super.paintComponent() first) and then add this JPanel to your JApplet.