• Post Reply Bookmark Topic Watch Topic
  • New Topic

Related to hanging of gui

 
Sachindra Pratap
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I facing the problem of gui hangup.
Well the issue is,in my gui there is jcombobox and jtextfield,both aside.
When combo is selected,request is sent to udp server,and in response,
some string is received ,which is set into jtextfield.

The moment value is set in textbox,there is timertask ,which start running.And in timer task value is read from jTextField2,if the length of
jTextField value is equal to 7 ,then that value is stored in global variable,
and jtextfield2 is set to blank ie jTextField2.setText("");

Well the,problem of gui hangup start after several combobox item selection.

Uptill GC.txt2=GC.jTextField2.getText();
It is working fine without gui hanging.
The moment GC.jTextField2.setText("");
is enabled after several times of comboBox item selection gui gets hang.

So please give reason why such problem is arising.

regards
Sachindra.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using Swing, you should probably use a Swing Timer not a util Timer. The advantage of the Swing Timer is that the code in its ActionListener is guaranteed to be called on the EDT.

My next question is: do you have some long-running code that is running on the EDT?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!