Please show me how i should correctly execute system proccess in java. I would like to do kinfd of console in java. I’ve made sth what looks like that.

How should I correctly invoke the process put in JTextField?
I know how to use listeners etc. I am only asking about running the process correctly. Thank You : ) But i would like to ensure that the whole layout will not freeze.
Use SwingWorker and put the action in the background. Do a Runtime.exec() with the contents in the background thread.
http://docs.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html