I want to create a "Command Console" similar to the Windows Command Prompt, with command history, etc which is in a JPanel so that it can be added to a JFrame.

What I want to do is present the user with the prompt to allow them to execute commands.

What I have in mind is similar to the BeanShell Console, however I haven't be able to find the source code for the console.