The implementation of this program is left to you as a lab (or programming) exercise, but here are some hints and suggestions:
Once you have successfully written and tested a simple interface, define the Primes class and write and test the isPrime() method. In order to write this method, you will have to complete the development of the algorithm described in the previous section. Use pseudocode to help you lay out the algorithm. You can use your interface to help you test the method. Have the user input an integer, and then just test whether that integer is prime.
Once you have a correct isPrime() method, write and test the findPrimes() methods. This last step should be very simple.
TextArea display; // Declare a variable
.
.
display = new TextArea(); // Create an instance (init() )
.
.
display.appendText ("blah") ; // Use it (actionPerformed() )
If you forget to instantiate in init() the use of display in actionPerformed() will cause a null pointer exception.