I am making my first "Top to Bottom" application, (an
applet) which computes all of the prime numbers between two starting values. I am displaying the results in a JTextArea. I am also attempting to provide error messages and updates in the same area. I do a:
theText.setText("Computing the primes ...");
just before I do the computations and the messate does not show up. I have tried adding:
repaint();
after it but this message is skipped. I did an:
Graphics screen
...
theText.update(screen)
and while this got the message to display it also generated a NullEventException.
While I could trap the exception, that is not very clean. I am NOT currently using threads. Is this my problem?? Does
Java not have enough time to update the display before my other computations have completed and they get displayed?