I want to be able to enter java commands / code to execute at runtime (while the "constant" program is running) in the same way or as close as possible to the same code will be executed if it was present in the program source code (programmed as part software) using a GUI element like jTextArea.
The following StackOverflow questions seem to be related, but like the answers to them, it seems not what I'm looking for.
How to get input from console class in Java?
Using GUI for console input and output in java
I don’t want to “be able to run actions from specific console inputs and print feedback in the console”, as it seems, in the case of the console applications described in this question, and the answers.
What I want is "to be able to run valid Java code, which I cannot predict and control, from input from the console (or GUI)."
NOTE: “I cannot predict and control” here refers to the “developer” ... But, of course, I can predict and “control” it if I am the one who enters the code because the “user” is done.
java , , ", "... , .
, , for(int i=0; i<3; i++){System.out.println(i);} "GUI" (jTextArea), , "" () "?" ) , , :
0
1
2
, :