Well, consider OOP fundamentals.
The only way a JTextField could be a String is if it extended String. And if you consult the
JavaDocs you'll see that it does not.
The quick answer to your question is:
String str = myTextField.getText();
Basically, you have to learn the APIs to write programs. How much you need to learn to accomplish the task at hand really is up to you. For a simple assignment, you might get away with a lot of cut & paste from various sources, and little more than changing some variable names. That's how most programmers operate anyway; find out how to do something through Google or whatever.