Run a non-GUI Java program online
I have a Java program that runs from command prompt / blueJ's terminal window fine.
Is there a way that I can run this from a browser?
I guess my question is, is there anything that simulates the terminal window in a browser?
If not, do you have a suggestion as to how to put this online? It uses scanner / system.out.println a lot.
Thank yo开发者_如何转开发u
There are two main technologies for helping publish a Java application via a browser:
- Applets (displays inside a browser, kind of like Flash)
- Java Web Start (launches via browser, but then runs and displays in a separate window.)
It most most common to use Swing to develop the user interface of an Applet or Java Web Start application. So it might be interesting to read about how to emulate a console window in Swing.
I'm not sure if this helps, but when you access a website that uses Java, with your browser, you can decide to see the Java console, if you have it enabled in your Java settings. But only people with that option turned on will get to see it.
Otherwise you could use javascript to incorporate results into the html of the page, or maybe make an applet with a "console" included.
You can embed in an applet, not only GUI you can use applets to invoke any method. And you can view console view ,[ Java Icon pops up on system tray bar in windows,on right clicking on the java icon, you can view console ]
精彩评论