GUI Console Input Output in Java JTextPane

If you’re a beginner in java programming, you probably found yourself stuck in this window when you design your first text-based app.

What if, you did create a useful console base app and you would love to run it outside of the IDE then, we have a problem. You have to set up the system path for the JDK command line compiler then you must locate your class file generated by the compiler and finally type the appropriate command followed by your class file name. It is a real pain! Maybe, you don’t want to go through all that.

I got good news for you! What if I say, you can run your text-based app with a single double-click from your mouse. No running the command prompt, no changing to the appropriate directory path and no typing the command and the class file name. Just one single click. Won’t you love that?

Get this nice window up and running without even creating a single object. All you have to do is add the “C.java” file to your main project package and type “C.io.” to access all the methods to print and get user input. “C.io” will be available to all your classes if you have more than one in your main package. Like this:

All you have to do is build your project and double-click the jar file. It’s that simple! I have the class available as a java file.

Click here to get the file