Welocome to the Ranch
You do not reverse the text in a text component.
You should not do anything like that in your Swing app. You should have a StringReverser class, or Reverser, with a method that reverses the
String passed to it. I shall give you a start
You get the text from somewhere and pass it to that method. Then you can use the returned text elsewhere.
That method gets all the information it uses from the arguments, and only returns information
via its return type, so it is a 1368 in the dreaded
Campbell Ritchie classification of methods. If you find 1368 you will find it is possible to make it static.
Don't use String Tokenizer. It went out of use as a legacy class nearly 15 years ago.