All pastes #640010 Raw Edit

Atualizacao.java

public java v1 · immutable
#640010 ·published 2007-07-31 00:56 UTC
rendered paste body
import javax.swing.*;// its goes for brazilian!!!!!!!!!!!// "Atualizando um JTextArea" ou "To Update a JTextArea" /* * Atualizacao.java * Author: Bruno G. * Date: 07/30/2007 */public class Atualizacao {    private JTextArea textArea;    public Testing() {        textArea = new JTextArea();        JFrame frame = new JFrame("Teste (Test)");        frame.add(textArea);        frame.setSize(800, 600);        frame.setVisible(true);                textArea.setText("Comecando (Starting)...\n");        for(int i = 1; i < 100; i ++) {            textArea.setText(textArea.getText() + i + ", ");            if (i % 10 == 0) {               textArea.setText(textArea.getText() + "\n");             }            try {            Thread.sleep(500);            } catch (InterruptedException e) {}        }        textArea.setText(textArea.getText() + "Fim (ended)");                System.out.println("fim para (end for)");    }    public static void main(String[] args) {        new Testing();    })// Bruno Goncalves