I am writing socket programming. It has a graphical interface for the server and client. The graphical interface of the server has a text field that shows the word requested by the user. But I have trouble showing the word.
I tried
txtWord.setText(sentword);
It does not show the word in the text box. But when I write it
txtWord.setText(sentword); JOptionPane.showMessageDialog(null, "the requesed word is: "+sentword);
then it shows the word in the text box and also shows it in the message box.
I tried redrawing (), but it works. Please offer me some solution as soon as possible.
source share