JavaFX Script

Last updated
JavaFX
JavaFX Logo.png
Developer Sun Microsystems
Stable release
1.2 / June 2, 2009 (2009-06-02)
Platform Java Runtime Environment
OS Cross-platform
License GPL
Website http://javafx.com/

JavaFX Script was a scripting language designed by Sun Microsystems, forming part of the JavaFX family of technologies on the Java Platform.

Contents

JavaFX targeted the Rich Internet Application domain (competing with Adobe Flex and Microsoft Silverlight), specializing in rapid development of visually rich applications for the desktop and mobile markets. JavaFX Script works with integrated development environments such as NetBeans, Eclipse and IntelliJ IDEA. JavaFX is released under the GNU General Public License, via the Sun sponsored OpenJFX project.

History

JavaFX Script used to be called F3 for Form Follows Function. F3 was primarily developed by Chris Oliver, who became a Sun employee through their acquisition of SeeBeyond Technology Corporation in September 2005.

Its name was changed to JavaFX Script, and it became open sourced at JavaOne 2007.

JavaFX 1.0 was released on December 4, 2008. [1] On September 10, 2010 Oracle announced at JavaOne that JavaFX Script would be discontinued, although the JavaFX API would be made available to other languages for the Java Virtual Machine. [2]

On September 27, 2010 Stephen Chin announced Visage a declarative user-interface language based on the JavaFX Script with enhancements. [3]

On April 8, 2012 a project was created with the intention of resurrecting and enhancing the original F3 programming language, but the project appears to have been discontinued in August 2015. [4]

Features

JavaFX Script was a compiled, statically typed, declarative scripting language for the Java Platform. It provided automatic data-binding, mutation triggers and declarative animation, using an expression language syntax (all code blocks potentially yield values.)

Through its standard JavaFX APIs it supported retained mode vector graphics, video playback and standard Swing components.

Although F3 began life as an interpreted language, prior to the first preview release (Q3 2008) JavaFX Script had shifted focus to being predominantly compiled. Interpreted JavaFX Script is still possible, via the JSR 223 'Scripting for Java' bridge. Because it is built on top of the Java Platform, it is easy to use Java classes in JavaFX Script code. Compiled JavaFX Script was able to run on any platform that has a recent Java Runtime installed.

Syntax

JavaFX Script's declarative style for constructing user interfaces can provide shorter and more readable source code than the more verbose series of method calls required to construct an equivalent interface if written in JavaFX Script's procedural style.

Here is a simple Hello world program for JavaFX Script :

importjavafx.stage.Stage;importjavafx.scene.Scene;importjavafx.scene.text.Text;importjavafx.scene.text.Font;Stage{title:"Hello World"width:250height:80scene:Scene{content:Text{font:Font{size:24}x:10,y:30content:"Hello World"}}}

It shows the following window/frame :

HelloWorld Java FX.jpg

This program can also be written in JavaFX Script using a procedural style this way:

importjavafx.stage.Stage;importjavafx.scene.Scene;importjavafx.scene.text.Text;importjavafx.scene.text.Font;javafx.scene.text.Font". var myFont:Font = Font.font(null, 24); var myText:Text = new Text(); myText.font = myFont; myText.x = 10; myText.y = 30; myText.content = "HelloWorld"; var myScene:Scene = new Scene(); myScene.content = myText; var myStage:Stage = new Stage(); myStage.title = "HelloWorld"; myStage.width = 250; myStage.height = 80; myStage.scene = myScene;

See also

Related Research Articles

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client–server web applications, with a reported 9 million developers.

<span class="mw-page-title-main">OSGi</span> Open standards organisation

OSGi is an open specification and open source project under the Eclipse Foundation. It is a continuation of the work done by the OSGi Alliance, which was an open standards organization for computer software founded in March 1999. The foundation originally specified and maintained the OSGi standard. The alliance transferred its work to the Eclipse Foundation at the end of 2020. The OSGi specification describes a modular system and a service platform for the Java programming language that implements a complete and dynamic component model, something that does not exist in standalone Java or VM environments. It has a service-oriented architecture based on micro services each implemented as an extended Java class file archive.

<span class="mw-page-title-main">Swing (Java)</span> Java-based GUI toolkit

Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an API for providing a graphical user interface (GUI) for Java programs.

<span class="mw-page-title-main">Standard Widget Toolkit</span>

The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java graphical user interface (GUI) toolkits provided by Sun Microsystems as part of the Java Platform, Standard Edition (J2SE).

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by the compiler.

<span class="mw-page-title-main">Processing</span> Free graphics library

Processing is a free graphical library and integrated development environment (IDE) built for the electronic arts, new media art, and visual design communities with the purpose of teaching non-programmers the fundamentals of computer programming in a visual context.

JScript .NET is a .NET programming language developed by Microsoft.

A user interface markup language is a markup language that renders and describes graphical user interfaces and controls. Many of these markup languages are dialects of XML and are dependent upon a pre-existing scripting language engine, usually a JavaScript engine, for rendering of controls and extra scriptability.

<span class="mw-page-title-main">Oxygene (programming language)</span> Object Pascal-based programming language

Oxygene is a programming language developed by RemObjects Software for Microsoft's Common Language Infrastructure, the Java Platform and Cocoa. Oxygene is based on Delphi's Object Pascal, but also has influences from C#, Eiffel, Java, F# and other languages.

Haxe is an open source high-level cross-platform programming language and compiler that can produce applications and source code, for many different computing platforms from one code-base. It is free and open-source software, released under the MIT License. The compiler, written in OCaml, is released under the GNU General Public License (GPL) version 2.

MooTools is a lightweight, object-oriented JavaScript framework. It is released under the free, open-source MIT License.

<span class="mw-page-title-main">JavaFX</span> Java software platform for GUI

JavaFX is a software platform for creating and delivering desktop applications, as well as rich web applications that can run across a wide variety of devices. JavaFX has support for desktop computers and web browsers on Microsoft Windows, Linux, and macOS, as well as mobile devices running iOS and Android.

<span class="mw-page-title-main">Clojure</span> Dialect of the Lisp programming language on the Java platform

Clojure is a dynamic and functional dialect of the Lisp programming language on the Java platform.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

<span class="mw-page-title-main">Vaadin</span>

Vaadin is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the Java programming language only, TypeScript only, or a combination of both.

<span class="mw-page-title-main">Lively Kernel</span> Open-source web programming environment

The Lively Kernel is an open-source web programming environment. It supports desktop-style applications with rich graphics and direct manipulation abilities, but without the installation or upgrade troubles of conventional desktop applications. Development began at Sun Microsystems Laboratories in Menlo Park, California, and later moved to the Hasso Plattner Institute in Potsdam-Babelsberg near Berlin.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. The programming language is designed for client development such as for the web and mobile apps, and it can also be used to build server and desktop applications.

FXML is an XML-based user interface markup language created by Oracle Corporation for defining the user interface of a JavaFX application. FXML presents an alternative to designing user interfaces using procedural code, and allows for abstracting program design from program logic.

References

  1. JavaFX 1.0 released
  2. JavaFX 2010-2011 Roadmap Archived 2010-10-29 at the Wayback Machine
  3. "Steve On Java » Announcing Visage – The DSL for Writing UIs". steveonjava.com. Archived from the original on 2010-10-01.
  4. unktomi (2022-07-31), unktomi/form-follows-function , retrieved 2023-03-30

Bibliography