favelill
asked on
Swing refresh textArea
Hi everybody,
I have a code like this:
public void disableResponse() {
taResultArea.setText("Send ing...");
taResultArea.setEnabled(fa lse);
repaint();
}
public void sendRequest() {
// Here I send something to a remote host
// ...
taResultArea.setText(respo nse);
taResultArea.setEnabled(tr ue);
}
And in the action of the button I call both methods, first disableResponse, then sendRequest. Of course the above code doesn´t work, because between the disableResponse call and the sendRequest call I don't allow java to do the repaint work.
I thought the repaint call was enough to do the work... I was wrong. I don't want to put the management of the textArea in a thread. Is there a work around of this without the using of threads?
Best regards,
favelill
I have a code like this:
public void disableResponse() {
taResultArea.setText("Send
taResultArea.setEnabled(fa
repaint();
}
public void sendRequest() {
// Here I send something to a remote host
// ...
taResultArea.setText(respo
taResultArea.setEnabled(tr
}
And in the action of the button I call both methods, first disableResponse, then sendRequest. Of course the above code doesn´t work, because between the disableResponse call and the sendRequest call I don't allow java to do the repaint work.
I thought the repaint call was enough to do the work... I was wrong. I don't want to put the management of the textArea in a thread. Is there a work around of this without the using of threads?
Best regards,
favelill
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.