JavaFX: Difference between revisions

Content deleted Content added
mNo edit summary
Tags: Reverted Visual edit Mobile edit Mobile web edit
m top: Updated latest version to 24.0.2
Tags: Mobile edit Mobile app edit Android app edit App section source
 
(7 intermediate revisions by 5 users not shown)
Line 1:
•[[Autoruns|F(x)=K=Jav]]{{autograph;}}{{short description|Java softwareGUI platform for GUIFramework}}
{{Infobox software
| name = JavaFX
Line 5:
| developer = [[Oracle Corporation]]
| released = {{Start date and age|2008|12|04}}
| latest release version = 2124.0.2
| latest release date = {{Start date and age|20242025|0106|1615}}<ref>{{Cite web|url=https://gluonhq.com/products/javafx/|title=Products » JavaFX|access-date=20232025-0608-2029}}</ref>
| latest preview version =
| latest preview date =
Line 26:
== Features ==
{{Outdated|part=Features|date=July 2023|reason=}}
JavaFX 1.1 was based on the concept of a "common profile" that is intended to span across all devices supported by JavaFX. This approach makes it possible for developers to use a common programming model while building an application targeted for both desktop and mobile devices and to share much of the code, graphics assets and content between desktop and mobile versions. To address the need for tuning applications on a specific class of devices, the JavaFX 1.1 platform includes [[application programming interface|APIs]] that are desktop or mobile-specific. For example, the JavaFX Desktop profile includes [[Swing (Java)|Swing]] and advanced visual effects. JavaFX places all its symbols in the namespace <code>javafx</code>.
 
For the end user, the "Drag-to-Install" feature enables them to drag a JavaFX widget - an application residing in a website - and drop it onto their desktop. The application will not lose its state or context even after the browser is closed. An application can also be re-launched by clicking on a shortcut that gets created automatically on the user's desktop.
Line 52:
 
Sun planned to enable out-of-the-box support of JavaFX on the devices by working with handset manufacturers and mobile operators to preload the JavaFX Mobile runtime on the handsets. JavaFX Mobile running on an Android was demonstrated at [[JavaOne]] 2008 and selected partnerships (incl. [[LG Electronics]], [[Sony Ericsson]]) were announced at the JavaFX Mobile launch in February, 2009.
 
=== Example ===
To launch a JavaFX application, the main class extends <code>javafx.application.Application</code> and <code>main()</code> calls <code>Application::launch</code> which internally calls <code>Application::start</code>, which is overriden by the main class and acts as the entry point of the application itself.
<syntaxhighlight lang="java">
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
 
public class JavaFXExample extends Application {
@Override
public void start(Stage primaryStage) {
Button button = new Button("Click Me!");
button.setOnAction(e -> System.out.println("Hello from JavaFX!"));
 
StackPane root = new StackPane(button);
Scene scene = new Scene(root, 300, 200);
 
primaryStage.setTitle("JavaFX Example");
primaryStage.setScene(scene);
primaryStage.show();
}
 
public static void main(String[] args) {
launch(args);
}
}
</syntaxhighlight>
 
== Components ==
The JavaFX platform includes the following components:
 
* The JavaFX [[Software development kit|SDK]]: Including among other things graphics, media services, rich text libraries, and the web view.
* [[NetBeans]] IDE for JavaFX: NetBeans with drag-and-drop palette to add objects with transformations, effects and animations plus a set of samples and best practices. For Eclipse users there is a community-supported plugin hosted on e(fx)clipse.
* JavaFX Scene Builder: This was introduced for JavaFX 2.1 and later. A user interface (UI) is created by dragging and dropping controls from a palette. The layout is saved as an FXML file, which is a special XML format.
 
=== Modules ===
JavaFX is split into the following [[Java Platform Module System|modules]].<ref>{{Cite web|url=https://openjfx.io/javadoc/24/|title=Overview (JavaFX)|website=openjfx.io}}</ref>
{| class="wikitable"
! Name !! Description
|'''Type'''
|'''Description'''
|'''Applications'''
|-
| {{code|javafx.base}}
|'''Basic Matrix Heat Map'''
| Defines core APIs for the JavaFX UI toolkit (such as APIs for bindings, properties, collections, and events).
|Displays values in a 2D grid with color encoding. Simple structure without clustering or hierarchy.
|Gene expression, correlation matrices, simple statistics
|-
| {{code|javafx.controls}}
|'''Clustered Heat Map'''
| Defines the APIs for UI controls, charts, skins in the JavaFX UI toolkit.
|Extends matrix heat maps by grouping similar rows/columns using hierarchical clustering and dendrograms.
|Genomics, customer segmentation, biological networks
|-
| {{code|javafx.fxml}}
|'''Annotated Heat Map'''
| Defines the FXML APIs in the JavaFX UI toolkit.
|Each cell includes a numeric label to show exact value along with color gradient.
|Dashboard reporting, business intelligence, health data
|-
| {{code|javafx.graphics}}
|'''Geographic Heat Map'''
| Defines scenegraph, animation, geometry, and other related APIs for the JavaFX UI toolkit.
|Overlay of intensity values on maps, usually by region or ___location coordinates.
|Crime mapping, election results, population studies
|-
| {{code|javafx.media}}
|'''Point Density Heat Map'''
| Defines media playback and audio content APIs for the JavaFX UI toolkit.
|Displays density based on point events (without relying on regions).
|Epidemiology, traffic analysis, hotspot detection
|-
| {{code|javafx.swing}}
|'''Interactive Heat Map'''
| Defines JavaFX/[[Swing (Java)|Swing]] interop support APIs for the JavaFX UI toolkit.
|Digital maps with interactivity such as zoom, filter, tooltips for values.
|Web usability, marketing analysis, behavioral tracking
|-
| {{code|javafx.web}}
|'''3D/Volumetric Heat Map'''
| Defines WebView APIs for the JavaFX UI toolkit.
|Visualizes values in three dimensions or volume scans (e.g., medical imaging).
|MRI analysis, neuroscience, CT scan analysis
|-
| {{code|jdk.jsobject}}
|'''Temporal (Calendar) Heat Map'''
| Defines APIs for [[JavaScript]] objects.
|Heat maps organized by time blocks (calendar, weekly, daily patterns).
|Activity visualization, GitHub commits, sales tracking
|-
| {{code|jfx.incubator.input}}
|'''Multivariate Heat Map'''
| Incubates mechanism for customising JavaFX controls.
|Encodes more than one variable using color, size, shape, or annotation in each cell.
|AI interpretability, genomics, data dashboards
|-
| {{code|jfx.incubator.richtext}}
|'''Correlogram'''
| Incubates RichTextArea control for JavaFX.
|A symmetric matrix showing pairwise correlations, often with color intensity and signs.
|Economics, psychology, education research
|}
 
== Components ==
 
The JavaFX platform includes the following components:
 
* The JavaFX [[Software development kit|SDK]]: Including among other things graphics, media services, rich text libraries, and the web view.
* [[NetBeans]] IDE for JavaFX: NetBeans with drag-and-drop palette to add objects with transformations, effects and animations plus a set of samples and best practices. For Eclipse users there is a community-supported plugin hosted on e(fx)clipse.
* JavaFX Scene Builder: This was introduced for JavaFX 2.1 and later. A user interface (UI) is created by dragging and dropping controls from a palette. The layout is saved as an FXML file, which is a special XML format.
 
== History ==