How to check JTextField text to String?
问题 I have a problem on checking the text and string. public boolean Isequals(Object c){ boolean check = false; if (c instanceof MyTextTwist){ MyTextTwist tt = (MyTextTwist)c; if (txtGuessPad.getText().equals(answer)) check = true;} return check; } this what i have so far. 回答1: Since your question is not very clear, i suggest these answers: 1st option - you want to get string from your JTextField: String text = txtGuessPad.getText(); 2nd option - you want to check if text contains only letter: