#Open CMD in .jar file (Windows)

17 messages ยท Page 1 of 1 (latest)

leaden jewel
#

Every project that I do in Java, nowadays, I compile without a UI. It's not a problem to create a .bat file to run my jar in the CMD, but:

I wonder if I can "emulate" the terminal inside my .jar file... So the user just double clicks my .jar and play my game or application.

Might help:
Have you ever opened a server.jar from Minecraft? Kinda like that. We have all the UI but in the right we have the terminal. Executing the tasks... opening the world etc.

torn flareBOT
#

โŒ› This post has been reserved for your question.

Hey @leaden jewel! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

leaden jewel
#

This, in the right, is the terminal. Right?

rose jay
#

That's a JTextArea

#

You use setOut and setErr to pass the print calls over to the area

#

And to make it vertically scrollable, you put the JTextArea in a JScrollPane

leaden jewel
#

Thank you. Helped a lot

torn flareBOT
# leaden jewel Thank you. Helped a lot

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

leaden jewel
#

I'll use netbeans to do this

rose jay
#

Use whatever you find comfortable.

#

By the way

#

If you want to see how the console log in JTextArea works, I posted a 7z file to a source of a downloader which does exactly this, in #1020064092196716614

#

you might wanna take a peek at how it was done and get the general gist of it

leaden jewel
#

Ok, thanks

#

๐Ÿ™๐Ÿผ๐Ÿ‘๐Ÿผ