Creating rich Internet applications with compiled JavaFX script technology

Source: Internet
Author: User
Tags zip java se

The JavaFX series of technologies currently includes two products: JavaFX Script and JavaFX Mobile platform. The latter is a platform for mobile phones and other mobile devices. The 18 articles in this series focus on the JavaFX script programming language, a simple and elegant scripting language that leverages the powerful capabilities of the Java platform. Further, these series of articles cover the compiled JavaFX Script, which has undergone a complete development cycle. You may have learned that JavaFX script has an interpreted version that essentially serves as the prototype of the compiled version JavaFX script is a static type and is fully object-oriented.

You'll see that using JavaFX Script makes it easy to develop a responsive rich graphical user interface (GUI). Part of the attraction is that even if developers do not have in-depth programming knowledge, they can develop graphical content to create an amazing user interface (UI).

Java SE 6 update N is some of the newer names for Java Platform, Standard Edition 6 (Java SE 6), typically 6uN, which implements the latest version of jvm* deployments and dramatically accelerates Java applets And the speed at which the application starts. Plus JavaFX Script is compiled into JVM bytecode, so you can provide us with fast-deployable, fast-executing graphical rich clients.

Now that you have a basic understanding of the implications of JavaFX technology and Java SE 6 Update N, let's look at some compiled JavaFX Script code that is slightly more complex than the typical Hello world program. With this code, you will be able to experience how simple it is to create a compiled JavaFX program that contains UI components and 2D graphics. The next section shows how to compile and run the sample program.

Get the JavaFX Script compiler

Before compiling and running the JavaFX Script, you first need to get the latest version of the JavaFX compiler. This can be accomplished by using the following procedure. Note: You must compile and run the JavaFX Script using JRE version 5 or later.

Download the latest version of the compiler.

Unzip the Archive.zip file to a directory in the system.

Set the PATH environment variable to include the Archive/openjfx-compiler/dist/bin subdirectory of the directory used when extracting the Archive.zip file.

Compiling and running the HELLOCOMPILEDJAVAFX program

Because the program uses a package statement, the source code must be in the same directory as the directory name and package name. Save the program to a file named Hellocompiledjavafx.fx in the MyPackage directory. To compile this program, set the current directory to the MyPackage directory and execute the JAVAFXC command script, enter the following command:

JAVAFXC hellocompiledjavafx.fx

To run the program, access the directory where you saved the package, and enter the following command:

javafx mypackage.HelloCompiledJavaFX

Figure 1 shows the window that will appear.

Figure 1: The main window of the application

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.