PageSourceSearch

https://openjfx.cn/highlights/24/

html openjfx.cn collected 2026-10-05 22:03:08 UTC 18,106 bytes, 239 lines download raw bytes

1<!DOCTYPE html>
2<html>
3<head>
4    <meta charset="utf-8">
5    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6    <title>JavaFX24亮点 | JavaFX中文官方网站</title>
7    <meta name="viewport" content="width=device-width, initial-scale=1">
8    <meta http-equiv="content-language" content="en-us" />
9    <meta name="keywords" content="OpenJFX,openjfx.cn,openjfx.io,javafx,javafx8,javafx11,javafx12,javafx13,javafx14,javafx15,javafx16,javafx17,javafx18,javafx19,javafx项目,javafx下载,javafx中文,openjfx下载,openjfx中文,开源代码,javafx项目,openjfx官方,openjfx11,openjfx12,openjfx13,openjfx14,openjfx15">
10    <meta name="description" content="OpenJFX 是一个开源项目,用于桌面、移动端和嵌入式系统的下一代客户端应用程序平台。openjfx.cn是OpenJFX(JavaFX)的标准中文翻译网站,致力于方便开发者阅读官方文档和教程。">
11    <meta content="OpenJFX 是一个开源项目,用于桌面、移动端和嵌入式系统的下一代客户端应用程序平台。openjfx.cn是OpenJFX(JavaFX)的标准中文翻译网站,致力于方便开发者阅读官方文档和教程。" property="og:description">
12    <meta content="./logo.png" itemprop="image" property="og:image">
13    <meta name="og:title" content="JavaFX 24 亮点-JavaFX中文官方网站"/>
14    <meta name="og:description" content="OpenJFX 是一个开源项目,用于桌面、移动端和嵌入式系统的下一代客户端应用程序平台。openjfx.cn是OpenJFX(JavaFX)的标准中文翻译网站,致力于方便开发者阅读官方文档和教程。"/>
15    <meta name="og:url" content="https://openjfx.cn/highlights/19/"/>
16    <meta name="og:site_name" content="JavaFX中文官方网站"/>
17    <meta name="og:type" content="website"/>
18    <meta http-equiv="X-UA-Compatible" content="IE=edge">
19    <link rel="icon" sizes="32x32" href="/favicon.ico">
20    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
21    <link rel="apple-touch-icon-precomposed" sizes="180x180" href="/favicon.ico">
22    <link href='https://fonts.loli.net/css?family=Source+Sans+Pro:400,300,600,400italic,700' rel='stylesheet' type='text/css'>
23    <link rel="stylesheet" href="/css/animate.css">
24    <link rel="stylesheet" href="/css/icomoon.css">
25    <link rel="stylesheet" href="/css/simple-line-icons.css">
26    <link rel="stylesheet" href="/css/magnific-popup.css">
27    <link rel="stylesheet" href="/css/bootstrap.css">
28    <link rel="stylesheet" href="/css/style.css">
29    <link rel="stylesheet" href="/css/custom1.css">
30    <link rel="stylesheet" href="/css/custom2.css">
31    
31<script src="/js/modernizr-2.6.2.min.js"></script>
31
32</head>
33<body class="content">
34    <header role="banner" id="fh5co-header">
35        <div class="container">
36            
37            <nav class="navbar navbar-default">
38                <div class="navbar-header">
39                    
40                    <a href="#" class="/js-fh5co-nav-toggle fh5co-nav-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"><i></i></a>
41                    <a class="navbar-brand" href="/index.html">JavaFX</a> 
42                </div>
43                <div id="navbar" class="navbar-collapse collapse">
44                  <ul class="nav navbar-nav navbar-right">
45                    <li><a class="external" href="/index.html" data-nav-section="home"><span>主页</span></a></li>
46                    <li><a class="external" href="/index.html#fh5co-documentation"><span>文档</span></a></li>
47                    <li><a class="external" href="/index.html#fh5co-link" data-nav-section="link"><span>链接</span></a></li>
48                    <li><a class="external" href="/index.html#fh5co-work"><span>社区</span></a></li>
49                    <li><a class="external" href="/index.html#fh5co-testimonials"><span>评价</span></a></li>
50                    <li class="active"><a href="/highlights/24"><span>亮点</span></a></li>
51                </ul>
52            </div>
53        </nav>
54        
55    </div>
56</header>
57	<section id="fh5co-home" data-section="home" style="background-image: url(/images/full_image_2.jpg);" data-stellar-background-ratio="0.5">
58		<div class="gradient"></div>
59		<div class="container">
60        <div class="high-wrap">
61            <div class="row">
62                <div class="col-md-12">
63                    <div class=box><h1 id=javafx-24-highlights>JavaFX 24 亮点</h1>
64                        <p class=content>JavaFX version 24 has been released. We&rsquo;ve tailored down some of the most
65                            exciting parts of the release in this document.</p>
66                        <h2 id=important-changes>Important Changes</h2>
67                        <h3 id=javafx-24-requires-jdk-22-or-later>JavaFX 24 Requires JDK 22 or Later</h3>
68                        <p class=content>JavaFX 24 is compiled with <code>--release 22</code> and thus requires JDK 22
69                            or later in order to run. If you attempt to run with an older JDK, the Java launcher will
70                            exit with an error message indicating that the <code>javafx.base</code> module cannot be
71                            read.</p>
72                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8340003>JDK-8340003</a> for
73                            more information.</p>
74                        <h3 id=javafx-applications-must-use---enable-native-access>JavaFX Applications Must Use <code>--enable-native-access</code>
75                        </h3>
76                        <p class=content>Running a JavaFX application on JDK 24 will produce a warning from each of the
77                            three JavaFX modules that rely on native access, due to the changes specified in <a
78                                    href=https://openjdk.org/jeps/472>JEP 472</a>. Each warning will include the
79                            following message:</p>
80                        <pre><code>WARNING: Restricted methods will be blocked in a future release unless native access is enabled
81</code></pre>
82                        <p class=content>In order to suppress the warning now, and to be able to run your application at
83                            all in a subsequent version of the JDK, you need to explicitly enable native access for all
84                            modules that need it. This is done by passing <code>--enable-native-access=&lt;list-of-modules></code>
85                            to <code>java</code> on the command line, listing the modules that you grant native access.
86                            This list of modules includes <code>javafx.graphics</code> and, optionally, <code>javafx.media</code>
87                            and <code>javafx.web</code>, if your application uses those modules.</p>
88                        <p class=content>For example:</p>
89                        <pre><code>java --enable-native-access=javafx.graphics,javafx.media,javafx.web
90</code></pre>
91                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8347744>JDK-8347744</a> for
92                            more information.</p>
93                        <h3 id=the-jdkjsobject-module-is-now-included-with-javafx>The <code>jdk.jsobject</code> Module
94                            is Now Included with JavaFX</h3>
95                        <p class=content>The <code>jdk.jsobject</code> module, which is used by JavaFX WebView
96                            applications, is now included with JavaFX, replacing the JDK module of the same name. The
97                            <code>jdk.jsobject</code> module is deprecated as of JDK 24, and will be removed in a future
98                            release of the JDK.</p>
99                        <p class=content>To facilitate the transition, <code>jdk.jsobject</code> is now an upgradable
100                            module in the JDK. This means that the version of <code>jdk.jsobject</code> delivered with
101                            JavaFX can be used in place of the one in the JDK to avoid the compiler warning. This can be
102                            done as follows:</p>
103                        <p class=content>Go through <a
104                                href=https://github.com/openjdk/jfx/blob/jfx24/doc-files/release-notes-24.md>JavaFX 24
105                            release notes</a> or <a href=https://bugs.openjdk.org/browse/JDK-8337280>JDK-8337280</a> for
106                            more information.</p>
107                        <h3 id=pluggable-image-loading-via-javaximageio>Pluggable Image Loading via
108                            <code>javax.imageio</code></h3>
109                        <p class=content>JavaFX 24 supports the Java Image I/O API, allowing applications to use
110                            third-party image loaders in addition to the built-in image loaders.
111                            This includes the ability to use variable-density image loaders for formats like SVG. When
112                            an image is loaded using a variable-density image loader, JavaFX rasterizes the image with
113                            the screen&rsquo;s DPI scaling.</p>
114                        <p class=content>Applications that want to use this feature can use existing open-source Image
115                            I/O extension libraries, or register a custom Image I/O service provider instance with the
116                            <code>IIORegistry</code> class.
117                            Refer to the Java <a
118                                    href=https://docs.oracle.com/en/java/javase/23/docs/api/java.desktop/javax/imageio/package-summary.html>Image
119                                I/O documentation</a> for more information.</p>
120                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8306707>JDK-8306707</a> for
121                            more information.</p>
122                        <h3 id=scrollpane-consumes-navigation-keys-only-when-it-has-direct-focus><code>ScrollPane</code>
123                            Consumes Navigation Keys Only When It Has Direct Focus</h3>
124                        <p class=content><code>ScrollPane</code> now only responds to key events when it is the active
125                            focus owner. This ensures that custom controls and other UI elements work correctly inside a
126                            <code>ScrollPane</code>, providing a more consistent and intuitive navigation experience.
127                        </p>
128                        <p class=content>Applications that prefer the previous behavior, where <code>ScrollPane</code>
129                            always reacts to arrow keys and other navigational inputs, can manually restore it by adding
130                            an event handler. See <a
131                                    href=https://github.com/openjdk/jfx/blob/jfx24/doc-files/notes/24/JDK-8340852-ScrollPane.md>this
132                                note</a> for an example of how to do this.</p>
133                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8340852>JDK-8340852</a> for
134                            more information.</p>
135                        <h2 id=removed-features-and-options>Removed Features and Options</h2>
136                        <h3 id=javafx-no-longer-supports-running-with-a-security-manager>JavaFX No Longer Supports
137                            Running With a Security Manager</h3>
138                        <p class=content>The Java Security Manager has been permanently disabled in JDK 24 via <a
139                                href=https://openjdk.org/jeps/486>JEP 486</a>.</p>
140                        <p class=content>Likewise, as of JavaFX 24, it is no longer possible to run JavaFX applications
141                            with a security manager enabled. This is true even if you run your application on an older
142                            JDK that still supports the security manager.</p>
143                        <p class=content>The following exception will be thrown when the JavaFX runtime is initialized
144                            with the Security Manager enabled:</p>
145                        <blockquote><p class=content>NOTE: UnsupportedOperationException: JavaFX does not support
146                            running with the Security Manager</p></blockquote>
147                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8341090>JDK-8341090</a> for
148                            more information.</p>
149                        <h2 id=known-issues>Known Issues</h2>
150                        <h3 id=javafx-warning-printed-for-use-of-terminally-deprecated-methods-in-sunmiscunsafe>JavaFX
151                            Warning Printed for Use of Terminally Deprecated Methods in <code>sun.misc.Unsafe</code>
152                        </h3>
153                        <p class=content>Running a JavaFX application on JDK 24 will produce a warning the first time
154                            any UI Control or complex shape is rendered:</p>
155                        <pre><code>WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
156...
157WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
158</code></pre>
159                        <p class=content>To disable this warning, pass
160                            <code>--sun-misc-unsafe-memory-access=allow</code> to <code>java</code> on the command line.
161                            For example:</p>
162                        <pre><code>java --sun-misc-unsafe-memory-access=allow
163</code></pre>
164                        <p class=content>This will be fixed in a subsequent version of JavaFX, after which time this
165                            flag will no longer be needed.</p>
166                        <p class=content>See <a href=https://bugs.openjdk.org/browse/JDK-8345121>JDK-8345121</a> for
167                            more information.</p>
168                        <p class=content>Exciting features:</p>
169                        <ul>
170                            <li><p class=content>New APIs:</p>
171                                <ul>
172                                    <li>InputMap is now public API as an Incubator</li>
173                                    <li>Focus traversal API is now public for use in custom controls</li>
174                                </ul>
175                            </li>
176                            <li><p class=content>New Features:</p>
177                                <ul>
178                                    <li>A new RichTextArea Control is now in Incubator</li>
179                                    <li>Support &ldquo;@1x&rdquo; image naming convention as fallback</li>
180                                    <li>Support pluggable image loading via javax.imageio</li>
181                                </ul>
182                            </li>
183                        </ul>
184                        <p class=content>Improvements:</p>
185                        <ul>
186                            <li>Tree-structural pseudo-classes are now supported in JavaFX CSS</li>
187                        </ul>
188                        <p class=content>The community came together to fix 57 bugs in the last 6 months. Following are
189                            major bug-fixes that went into JavaFX 24:</p>
190                        <ul>
191                            <li>Fix for application window not always activated on macOS 15</li>
192                            <li>Fix for css transition not started when initial value was not specified</li>
193                            <li>Fix for infinite loop occurs while resolving lookups</li>
194                            <li>Fix for IOOBE when adding data to a Series of a BarChart that already contains data</li>
195                        </ul>
196                        <p class=content>Finally, these are some dependency upgrades in JavaFX 24:</p>
197                        <ul>
198                            <li>Update libFFI to 3.4.6</li>
199                            <li>Update Glib to 2.82.4</li>
200                            <li>Update GStreamer to 1.24.10</li>
201                            <li>Update WebKit to 619.1</li>
202                            <li>Update libxslt to 1.1.42</li>
203                        </ul>
204                        <p class=content>A more comprehensive list of all the changes in JavaFX 24 can be found on <a
205                                href=https://gitee.com/openjfx/jfx/blob/jfx24/doc-files/release-notes-24.md>Gitee</a>.
206                        </p>
207                        </div>
208                </div>
209            </div>
210        </div>
211    </div>
212	</section>
213</div>
214	<footer id="footer" role="contentinfo">
215		<div class="container">
216			<div class="">
217				<div class="col-md-12 text-center">
218					<p style="font-size:15px;margin-bottom: 0.5em;color: #52d3aa;"><a href="https://cloud.tencent.com/act/double11/go?spread_hash_key=UVuZF2">
218本站托管于腾讯云服务器上</a></p>
219                    本作品已根据<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" style="font-weight: normal;color: #52d3aa;">
220                        “知识共享署名-非商业4.0国际许可证” </a>进行许可。
221                    <br/>
222                    <br/>
223                    <p>本站资源翻译自openjfx.io, 由openjfx.cn翻译团队翻译。</p>
224                    <p>联系邮箱:[email protected]</p>
225				</div>
226			</div>
227		</div>
228	</footer>
229	
229<script src="/js/jquery.min.js"></script>
229
230	
230<script src="/js/jquery.easing.1.3.js"></script>
230
231	
231<script src="/js/bootstrap.min.js"></script>
231
232	
232<script src="/js/jquery.waypoints.min.js"></script>
232
233	
233<script src="/js/jquery.stellar.min.js"></script>
233
234	
234<script src="/js/jquery.countTo.js"></script>
234
235	
235<script src="/js/jquery.magnific-popup.min.js"></script>
235
236	
236<script src="/js/magnific-popup-options.js"></script>
236
237	
237<script src="/js/content.js"></script>
237
238</body>
239</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.