Ciao,
espongo subito il fatto.
Ho un Jframe, clicco su un bottone che mi deve far avanzare una percentuale (finta per fare l'esempio)nella console il thread cammina ma nel jtext no finche il bottone non rilascia l'avento.
come modificare?
Grazie ...
codice:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Testo extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private JTextField textProgressione;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Testo frame = new Testo();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Testo() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 85);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		textProgressione = new JTextField();
		textProgressione.setBounds(10, 11, 143, 20);
		contentPane.add(textProgressione);
		textProgressione.setColumns(10);

		JButton btnAvvia = new JButton("avvia");
		btnAvvia.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				aumentaTesto();
			}
		});
		btnAvvia.setBounds(182, 10, 89, 23);
		contentPane.add(btnAvvia);
	}

	/**
	 * metodo per avanzare il testo
	 */
	public void aumentaTesto() {
		for (int i = 0; i <= 100; i += 10) {
			System.out.println(i);
			textProgressione.setText(Integer.toString(i) + "%");
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
			}
		}

	}

}