tramite qualche guida ho cercato di create un'animazione...

su una stringa funziona benissimo!!!!

poi ho cercato di farlo su una file txt ma mi legge solo l'ultima riga....

lo script che ho creato è questo:

codice:
import java.awt.Color;
import java.awt.Graphics;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class AnimazioneTesto extends JPanel {
	private int x;
	private int y;
	private static String text;
	/**
	 * @param args
	 */
	public AnimazioneTesto() {
		x = -50;
		y = 150;
		//text = "Testo Scorrevole";
		setSize(400,300);
		
	}
	public void paint(Graphics g) {		
		g.setColor(Color.WHITE);
		g.fillRect(0, 0, 400, 300);
		g.setColor(Color.BLACK);
		g.drawString(text, x, y);
		System.out.println(x + " " + y);
	}
	public void start() {
		while(true){
			while(x <= getWidth()) {
				y--;
				x = getHeight()/2;
				repaint();
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}	
		}
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try {
			BufferedReader in = new BufferedReader(new FileReader("c://testo.txt"));
			String line = in.readLine();
			while(line != null){
				String s1 =line + "\n";
				text = s1;
				  try {
					line = in.readLine();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			JFrame frame = new JFrame("Scrolling text");
		    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		    AnimazioneTesto scrolling = new AnimazioneTesto();
		    frame.getContentPane().add(scrolling);
		    frame.setSize(400, 300);
		    frame.setVisible(true);
		    scrolling.start();
		}
		catch (IOException e) {
			e.printStackTrace();
		}
	}
}
perchè mi legge solo l'ultima riga???

aiuto!!!