having problems of inserting an object on my applet. But my text goes on it well and it moves across the screen of the applet or screen box. Do yous have any clues?
My Code is?

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.Graphics;
public class RacingCar extends JFrame{

/** Creates a new instance of RacingCar */
public RacingCar() {
add(new MovingRacingCar("Car Moving Along .... "));

}
public static void main(String[] args) {
RacingCar frame = new RacingCar();
frame.setTitle("RacingCar");
frame.setSize(400, 150);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setVisible(true);
}
// Inner class: Displaying a moving message
static class MovingRacingCar extends JPanel {
private String message = "Welcome to Java";
private int xCoordinate = 0;
private int yCoordinate = 20;

public MovingRacingCar(String message) {
this.message = message;

// Create a timer
Timer timer = new Timer(100, new TimerListener());
timer.start();
}

/** Paint message */
public void paintComponent(Graphics g) {
super.paintComponent(g);

if (xCoordinate > getWidth()) {
xCoordinate = -50;
}
xCoordinate += 5;
g.drawString(message, xCoordinate, yCoordinate);
}

class TimerListener implements ActionListener {
/** Handle ActionEvent */
public void actionPerformed(ActionEvent e) {
repaint();
}
class NewPanel extends JPanel {
protected void paintComponent(Graphics g){
super.paintComponent(g);
//g.drawLine(0,70,10,70);
//g.drawLine(0,60,50,60);
//g.drawLine(0,50,100,50);
//g.drawLine(0,40,150,40);
g.drawOval(0,80,50,15);
//g.drawString("Banner", 50, 30);
}
}
}
}
}