New to applets

I want to learn about applets, I want to display a number and then allow the user to input any number. After this i want to compare the input to the number displayed and say if it is correct or try again.