Posted March 13, 20196 yr I just simply want to remove the words from a Gui textfield, is there some simple way to do that or I have to redraw the text field? like say if (!TextField.isEmpty){ System.out.println("You have run this part!"); if(TextField.getText == "some invalid thing"){ TextField.clear(); // How do I clear the text already written inside this text field. } else{ System.out.println("Do the stuff you wanted to run"); } } intelliJ shows this deleteWords in all the available things, but is this what I need? If yes what is p_146177_1_ int type here?
March 14, 20196 yr Author On 3/13/2019 at 2:20 PM, diesieben07 said: GuiTextField#setText("") Also, you can't use == to compare strings, == does instance comparison. You need equals. Thanks. Yeah I know about that, I just wrote an example code there for explanation sorry for that. Edited March 14, 20196 yr by WaningMatrix
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.