Jump to content

creating a 'custom console' with Java swing and/or AWT

jetbuster

Thanks to me finding Netbeans and its drag n drop UI (similar to visual studio) I can now make java programs with ease. Right now im trying to make a 'custom console' however because all my java programs use scanner(system.in) I was wondering if I could set the scanner to watch the textfeild I use on the GUI and take inputs through it or tell the system that IN is the text being entered there.

It can be swing or the AWT versions because netbeans can do that :D

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

Yep you can do that, should look something like:

private string readConsole(String oldConsole){String c = textfield.tex.replace(oldConsole,""); // what has just been entered}

The above code should be triggered every time say you press enter.
You can then input that to the real console, read the reply and smack the reply into a log file or something.

Best regards Zahlio,
Unity asset developer - Game developer (http://playsurvive.com) - Computer Science student

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×