Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Micah, if this is the reason:
then would it work if the setText method was called from another method. For example, could David create a method (let's call it showWorking for argument's sake) inside the (outer) public class, and have the inner class call showWorking before it starts the calculation. If not, what about using the append method of JTextField? Hiran > Actually the reason it does not work is that you are in running in one thread and while you are in action perform the gui will not perform an update on the screen. And so when you set the text to "Working..." and then go on to perform the calculation no screen update is performed until you leave that method. The reason working is displayed when you enter a non numerical value is that "Working" is set in the text display and then an exception cause an exit from the action performed method. Now when update is called the text field is redrawn with working. > I'm not to familiar with GUI but you need to force a repaint or update after setText field is called. Other wise it is set to "Working" then to the result before the screen is updated. > > Hi > > Thanks
Replies: |
Sponsored Links
|