3

I have a Java program which is executed through the basic command line interface. I am wondering about put it in a window JFrame. Is it possible? How can I do?

Thank you.

3
  • 3
    It's not entirely clear what You want... Do you want a "console-emulator" in a JFrame, where you can type commands to your program and read responses? Commented Nov 20, 2011 at 9:54
  • I think he has a console application ( without GUI ), and he wants to expose it's functionality through the GUI. Commented Nov 20, 2011 at 9:56
  • That's right. I simply want to use a JFrame as "console-emulator", as KarlP said. Commented Nov 20, 2011 at 10:04

1 Answer 1

1

If you want command line inside a jFrame I think it is not a good idea. If the JFrame is started that means the program is already started. You have to start the program using command line or running a executable jar file.So there is no meaning in what you are going to do.

If you want to see your output inside a JFrame rather than in the command line, that can be done. You can look here for details of swing programmimng

Sign up to request clarification or add additional context in comments.

3 Comments

I don't mind to start the program using the CLI before call the JFrame.
If you use a JFrame you won't actually use CLI to start the Frame. Instead you can just double click the .jar file and run it. If you want the real output in a JFrame you can add it to a JFrame. Look the above mentioned link for java Swing Programming tutorial.
I just want to launch the program by 1 click. Can I create a *.jar file which run the program in CLI?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.