beginner's question about makin java animation

Iam a complete beginner in java ( totally blind about java^^).

I tried to make a simple animation(not as an applet) that has word(a simple "hello" word) moving from one point to another point horizontally inside a window.

I can make the window and the word "hello" inside the window,but i can't make the animation

here's the code i made:

// the ActiveFrame for making the window GUI

import java.awt.*;

import java.awt.event.*;

public class ActiveFrame extends Frame

{

public ActiveFrame()

{ addWindowListener

(new WindowAdapter()

{ public void windowClosing(WindowEvent e)

{ System.exit(0);}

}

);

setSize(300, 200);

setTitle(getClass().getName());

}

}

// the WindowText for making the text

import java.awt.*;

public class WindowText extends ActiveFrame

{

public void paint(Graphics g)

{

Font f = new Font("Monospaced", Font.BOLD, 16);

g.setFont(f);

g.drawString("Hello", 50,100);

}

public static void main(String[] args)

{

WindowText aframe = new WindowText();

aframe.setSize(500, 300);

aframe.setLocation(200, 100);

aframe.setTitle("Window Text Program");

aframe.show();

}

}

could someone help me for the animation's code?

thanks in advance.

btw: sorry for my bad english, i only got C on my english.

[1467 byte] By [Apin2001] at [2007-9-30 17:52:59]
# 1
you could start with an:int x = 50;Then modify to an:g.drawString("Hello", x,100);Then you could look at the Timer class ( http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html)and see how you could use that to update x and call repaint.
bsampieri at 2007-7-6 14:28:25 > top of Java-index,Security,Event Handling...
# 2

// the ActiveFrame for making the window GUI

import java.awt.*;

import java.awt.event.*;

class ActiveFrame extends Frame

{

public ActiveFrame()

{

addWindowListener

(new WindowAdapter()

{ public void windowClosing(WindowEvent e)

{ System.exit(0);}

}

);

setSize(300, 200);

setTitle(getClass().getName());

}

}

// the WindowText for making the text

public class WindowText extends ActiveFrame implements Runnable

{

int xpos = 50;

public void paint(Graphics g)

{

Font f = new Font("Monospaced", Font.BOLD, 16);

g.setFont(f);

g.drawString("Hello", xpos, 100);

}

public static void main(String[] args)

{

WindowText wt = new WindowText();

}

public WindowText()

{

Thread t = new Thread(this);

t.start();

this.setSize(500, 300);

this.setLocation(200, 100);

this.setTitle("Window Text Program");

this.show();

}

public void run()

{

int y=0;

while(y<60)

{

xpos++;

try

{

Thread.sleep(500);

}

catch (InterruptedException ex)

{ }

repaint();

}

}

}

talon747 at 2007-7-6 14:28:25 > top of Java-index,Security,Event Handling...
# 3
go hunt through javaboutique.comi patched a lot of the bouncing ball applet into ^
talon747 at 2007-7-6 14:28:25 > top of Java-index,Security,Event Handling...
# 4
pswhile(xpos<200)
talon747 at 2007-7-6 14:28:25 > top of Java-index,Security,Event Handling...
# 5
my thanks to bsampier and talon ^^ i think i get the idea,thank you
Apin2001 at 2007-7-6 14:28:25 > top of Java-index,Security,Event Handling...