1- Don't just throw code together you get from the internet. Take the time to really understand what's going on. You'll save yourself a ton of headaches. Recommended reading: Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
2- Don't call repaint() from a paint method, including paintComponent(). Use a Swing Timer instead, otherwise you're going to be constantly drawing, which is really going to eat up a lot of resources.
3- Your zero() method is doing the job of a DecimalFormat instance.
4- JPanel's paintComponent() method redraws the background, which in effect clears out any previously drawn frames. Start your paintComponent() method with a call to super.paintComponent() in order to maintain that functionality.