English 中文(简体)
non java-developer question
原标题:

Just a basic question about Java (haven t really done anything with it personally yet):

Is it possible to write a Java program that runs in a web browser (via JRE) on the client machine? Is something like Groovy or JavaFX really a wrapper for something that technically could be written in Java? I assumed that JavaFX at least was intended for the browser. However when I ran a sample JavaFX app from Netbeans, its a stand-alone app - not something running in the browser. In general, in the long run, or web browsers going by the wayside.

问题回答

That s probably Applet you re looking for. Though its usually ugly and too restricted.

FWIW, You can run the same JavaFX program in a web-browser if you change the "Execution Mode" in the project properties under "Run". It does essentially run as an applet.

Have you never heard of java applets? Really?

It is called an applet.

JavaFX is kind of competing against Adobe AIR. Its used to create applications that use Web Services. The best way to describe JavaFX is like a custom browser for a website. They have a lot of Twitter examples since they have a pretty easy to use API.

If you want to run a Java App in a regular browser like FireFox you can use a Java Applet.

You can also develop Web App with Java too! Google App Engine just added support for Java!

Hope that helps.

As other people have answered, applets is the way to execute java in the browser. Applets were one of the main reasons Java got so much attention back in the late 90 s. All of a sudden it was possible to write cool application on the web. That was really exciting back then!

While I did more in the past, I ve only done a little Java recently, and never JavaFX or Groovy. However, I can echo others and say that you can run a Java program called an applet through a browser.

What I haven t seen said is that if you download the Java Development Kit (JDK) you can run an applet directly on your desktop with the appletviewer program that comes with the JDK. Generally this is only done during development and testing in my experience.

It is not, however, required to write Java programs as applets. Instead, you can write a Java application and run it locally on your system.

In general, in the long run, or web browsers going by the wayside.

Do you mean "are browsers going by the wayside"? No way. Now, if you mean for Java work, it seems other technologies have largely replaced Java applets as means to running programs through the browser.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签