Hacking simulation game console
i want to make a very simple hacking simulation game which contain some buttons and a console but i am facing some problems with the console here is what i tried
1-i made the console a java edit panel i want to put the path string and make the user unable to delete it or edit it so i tried to use the .settext option but it delete the previous jedit panel content and i found the i am able to delete the the path .
2-once the user hit enter i want to see what he wrote and if what he wrote match any of the commands then some operation will be executed i didn't found any thing to handle the enter key so i used key pressed event and then i used this code to check if there is an enter
String hold=jp.gettext();
if(hold.endswith("\n");
do operation //this is where the operation excution will happend
the code worked just fine but is there is any function to handle the enter key event
now
1-which text panel is more appropriate to use it as a console?
2-how to set a non editable string inside the text frame so it would act as user path?
thanks