

JavaFX: One Codebase for Web, PC, and Mobile
source link: https://www.infoq.com/news/2021/07/javafx-web/?itm_source=infoq&itm_medium=popular_widget&itm_campaign=popular_content_list&itm_content=
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

JavaFX: One Codebase for Web, PC, and Mobile
Jul 12, 2021 1 min read
Gluon has published a status update for JavaFX, showing the way in which a single JavaFX codebase can be used across a PC (standard JavaFX), a mobile device with Android or iOS (through integrated GraalVM), and a beta of browser-based WebGL (through Gluon).
The new addition of WebGL expands the level of support into the browser client side, enabling developers to write the entire application in a single Java language or codebase, without requiring a specialized JavaScript frontend. The change can benefit developers who write client applications used across multiple device profiles or those who create web frontends that are hosted on web or packaged locally through techniques like Electron.
Pi4J contributor Frank Delporte published a guide and sample project designed to showcase the capability to deliver a single application across Mac and Raspberry Pi devices like the Elecrow CrowPi2 laptop. The project demonstrates how to use common libraries and stylesheets like ControlsFX and BootstrapFX to make JavaFX applications look similar to what users expect. This change can speed up development by using common shared components while retaining a familiar sense of style that applications simply "look different" than what users are used to.
Gluon’s approach delivers a fully client-side component that does not require anything on the server. When built, the JavaFX code is transpiled to JavaScript and then invokes WebGL code. This approach makes JavaFX web frontends accessible to serverless applications because no persistent server-side state is required.
While JavaFX provides the groundwork for cross-platform applications, usage is low across the industry with JavaScript/Web clients far more common. StackOverflow trends reports on similar cross-platform development trends show a relative rise of Flutter and React-native while JavaFX is largely unchanged. When compared against direct numbers, JavaFX has 120,000 students on Udemy compared to React-Native at 900,000 and Flutter at 1,500,000.
JavaFX was recently discussed on the Foojay podcast, with members indicating that the best approach for cross-platform applications is to select a common application style rather than to emulate each platform’s native environment. Developer Gerrit Grunwald pointed out that iOS controls are highly unique with state information commonly outside of the Object represented by the FX control.
Recommend
-
102
Oracle’s rich media web technology will be broken out of standard Java as of JDK 11, and will proceed at its own pace
-
126
A lot of user interface programmers (“frontend devs”) these days have never worked with anything except HTML and JavaScript. That’s a pity because, as I have previously argued, the web is not a very…
-
107
JavaFX及Java客户端技术的未来
-
12
K-means and decision tree using Weka and JavaFX Weka is one of the most known tools for Machine Learning in Java, which also has a great Java API including API f...
-
14
Computer Vision with JavaFX and DJL Computer Vision is not a new topic in Computer Science, but in the recent years it got a boost due the use of Neural Networks for cla...
-
3
Oct 2nd, 2019Desktop & Mobile Apps With a Single Codebase👇 Download Show
-
5
Blog Post Migrating Our Web Codebase from Flow to TypeScript In summer 2021, we migrated our codebase from Flow to TypeScript. There were many reasons for doing this, but the biggest ones were TypeS...
-
5
Sass and fxml with introspection and hot reload on JavaFX Mobile
-
12
Configuration Files and Potholes in Your Codebase
-
13
本文为作者原创,允许转载,不过请在文章开头明显处注明链接和出处!!! 谢谢配合~ 作者:stars-one链接:
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK