Java doubt
The question I have is about how a program in Java could end at any moment of the execution by writing a specific word.
The question I have is about how a program in Java could end at any moment of the execution by writing a specific word.
Partyhard, well, here is an example of how you can guide yourself:)
for example: in a jframe it generates a jtextfield and a jbutton: and in the event click or action of the jbutton place this:
if(jtextfield.getText().equals("SALIR")){
jframe.dispose();
}
and each time you click on the button, that code will get the text of the jtextfield and match it with what you wrote in the if evaluation. You can also do it with the equalsIgnoreCase.
Greetings: I hope I helped you!