Share E-Book

AuthorStephen Chin, Johan Vos, James Weaver

Build enhanced visual experiences and design and deploy modern, easy-to-maintain, client applications across a variety of platforms. This book will show you how these applications can take advantage of JavaFX’s latest user interface components, 3D technology, and cloud services to create immersive visualizations and allow high-value data manipulation. This book is a professional reference for building Java applications for desktop, mobile, and embedded in the Cloud age. It offers end-to-end coverage of the latest features in JavaFX 21 and 23. This third edition has been updated to include new features introduced in JavaFX 21 and 23, including NEW APIs: Map, FlatMap, and OrElse fluent bindings for ObservableValue, along with the new Subscription API. Additionally, it's updated to account for new bug fixes and overall improvements to existing functionality in Java. After reading this book, you will be equipped to upgrade legacy client applications, develop cross-platform applications in Java, and build enhanced desktop and mobile native clients. What You Will Learn Create modern client applications in Java using the latest JavaFX 21 and 23 Build enterprise clients that will enable integration with existing cloud services Use advanced visualization and 3D features Deploy on desktop, mobile, and embedded devices Who This Book Is For Professional Java developers who are interested in learning the latest client Java development techniques to fill out their skills set

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Passage locations
Tags
No tags
ISBN: 8868809974
Publisher: Apress
Publish Year: 2024
Language: 英文
Pages: 702
File Format: PDF
File Size: 18.4 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

The Definitive Guide to Modern Java Clients with JavaFX Cross-Platform Mobile and Cloud Development Updated for JavaFX 21 and 23 — Third Edition — Stephen Chin Johan Vos James Weaver
The Definitive Guide to Modern Java Clients with JavaFX Cross-Platform Mobile and Cloud Development Updated for JavaFX 21 and 23 Third Edition Stephen Chin Johan Vos James Weaver
The Definitive Guide to Modern Java Clients with JavaFX: Cross-Platform Mobile and Cloud Development Updated for JavaFX 21 and 23, Third Edition ISBN-13 (pbk): 979-8-8688-0997-2 ISBN-13 (electronic): 979-8-8688-0998-9 https://doi.org/10.1007/979-8-8688-0998-9 Copyright © 2024 by Stephen Chin, Johan Vos and James Weaver This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Melissa Duffy Development Editor: Laura Berendson Coordinating Editor: Gryffin Winkler Cover designed by eStudioCalamar Image by chevanon on Freepik (www.freepik.com) Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www. springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub (https://github.com/Apress). For more detailed information, please visit https://www. apress.com/gp/services/source-code. If disposing of this product, please recycle the paper Stephen Chin Belmont, CA, USA James Weaver Marion, IN, USA Johan Vos Gluon Leuven, Belgium
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
xiii About the Authors Stephen Chin is VP of Developer Relations at Neo4j and author of additional titles including Raspberry Pi with Java, Pro JavaFX Platform, and DevOps Tools for Java Developers. He has keynoted numerous conferences around the world, including AI DevSummit, Devoxx, DevNexus, JNation, JavaOne, Joker, swampUP, and Open Source India. Stephen is an avid motorcyclist who has done evangelism tours in Europe, Japan, and Brazil, interviewing hackers in their natural habitat. When he is not traveling, he enjoys teaching kids how to do AI, embedded, and robot programming together with his daughters. Johan Vos started to work with Java in 1995. He was part of the Blackdown team, porting Java to Linux. His main focus is on end-to-end Java, combining back-end systems and mobile/embedded devices. He received a Duke Choice award in 2014 for his work on JavaFX on mobile. In 2015, he co-founded Gluon, which allows enterprises to create (mobile) Java Client applications leveraging their existing backend infrastructure. Gluon received a Duke Choice award in 2015. Johan is a Java Champion and an Oracle Developer Champion and a member of the BeJUG steering group, the Devoxx steering group, and a JCP member. He has been a speaker at numerous conferences on Java. James Weaver is a Java developer, author, and speaker with a passion for cloud-native applications, machine learning, and quantum computing. He is a Java Champion and a JavaOne Rockstar. James has written books including Inside Java, Beginning J2EE, the Pro JavaFX series, and Java with Raspberry Pi. As a Pivotal Developer Advocate, James speaks internationally at software technology conferences. He tweets at @JavaFXpert.
xv About the Technical Reviewer José Pereda, PhD, who specializes in structural engineering, works as a software engineer at Gluon Software. He is a Java Champion and JavaOne Rockstar. Having worked with Java since 1999, he is a JavaFX advocate, developing Java applications for mobile and embedded platforms connected to the cloud and enterprise systems, while he is an active member of OpenJFX (with reviewer role, https://openjdk.org/ census#jpereda) and other open source projects like FXyz 3D (https://github. com/jperedadnr), co-authors JavaFX-related books (such as JavaFX 8: Introduction by Example, JavaFX 9 by Example, and The Definitive Guide to Modern Java Clients with JavaFX, all published by Apress), blogs (http://jperedadnr.blogspot.com. es/), tweets (@JPeredaDnr), and speaks at JUGs and conferences (JavaOne, Devoxx, JAX, Jfokus, JavaLand, JCrete, JBCNConf, to name a few). José lives with his family in Valladolid, Spain.
xvii Contributors We would like to express our gratitude to the contributors who helped lay the foundation for this book with their insights and expertise in past editions. In particular, we extend our thanks to: Gail C. Anderson Paul L. Anderson Bruno Borges Anton Epple Weiqi Gao Jonathan Giles José Pereda Sven Reimers Eugene Ryzhikov William Antônio Siqueira
1 © Stephen Chin, Johan Vos and James Weaver 2024 S. Chin et al., The Definitive Guide to Modern Java Clients with JavaFX, https://doi.org/10.1007/979-8-8688-0998-9_1 CHAPTER 1 Getting Started with Client Java Written by Stephen Chin Client technologies are the basis for building any interface that users interact with. Because they are the first part of an application that a user sees, they also leave the greatest impact on your audience. Therefore, it is important that user interfaces look good and also are easy to use and intuitive. Whether it be desktop, mobile, tablet, or embedded devices, Java client technologies provide a simple and elegant solution to building modern user experiences. Because the Java language is cross-platform, this reduces the effort to build and maintain your application for multiple screens and form factors. Also, as one of the most widely used programming languages, anyone can help maintain your code, making it a solid foundation for the future. In this chapter, we will show some examples of Java client technology in action and guide you through building your own cross-platform client to demonstrate how easy it is to accomplish this. Java Client Technology in Action Java client technology has been used for decades for all sorts of applications from business applications to development tools and even games. Also, now that Java runs on mobile and embedded platforms, you also find Java applications on your phone, tablet, and Raspberry Pi devices. It is often hard to tell if you are using a Java application because it is packaged together with the required Java libraries, so it appears just like any other native application. We will explore several different Java client applications that you may or may not have used to give you an idea of the potential of this technology.
2 Java Clients in Business Java client technology is a staple in enterprise companies for internal applications. This is because it is great at building highly customized applications with complex controls like graphs, trees, tables, and Gantt charts. By building applications once and taking advantage of Java’s cross-platform capabilities, enterprises save on initial implementation cost as well as maintenance. Common use cases for Java client technology in the industry are high-speed trading, train monitoring and scheduling, supply chain management, medical imaging, and inventory management. MINT systems make a training and resource management system (TRMS) that has been adopted by numerous commercial airlines such as Emirates Airlines, JetBlue Airways, Azul Linhas Aéreas Brasileiras, FedEx Express, Lufthansa Group, and the Avianca-Taca Group.1 Figure 1-1. MINT software system for airline training and resource management2 1 MINT Software Systems – European Airline Training Symposium (EATS). Retrieved from www.eats-event.com/mint/. July 19, 2019. 2 Casall, Alexander. 20 JavaFX real-world applications. Retrieved from https://jaxenter. com/20-javafx-real-world-applications-123653.html. February 11, 2016. See also https://www.jfx-central.com/real_world/mint Chapter 1 GettinG Started with Client Java
3 Figure 1-1 shows one of the more complex user interface screens from MINT TRMS. It makes use of trees, tables, ribbons, and Gantt charts implemented using the latest Java client technology, JavaFX. JavaFX is a user interface toolkit that provides all of the layouts, controls, and charts that you need to build modern applications. This demonstrates a very complex view that would be challenging to implement in any other cross-platform technology. To find out more about how you can easily build complex applications using pre- built JavaFX controls, check out Chapter 4, “JavaFX Controls Deep Dive.” Gaming and 3D Java client technology is also great for building games. One of the most popular games of all time was built by a single person using Java technology. Markus Persson (aka Notch) released a development version of Minecraft in 2009.3 All the initial development was done in his spare time until the alpha release made enough money so he could start his own company, Mojang, and focus on the game full time. It is now the world’s second highest-grossing video game with 91 million monthly users.4 3 Wikipedia. Minecraft. Retrieved from https://en.wikipedia.org/wiki/Minecraft. August 2019. 4 Gilbert, Ben. “Minecraft” is still one of the biggest games in the world, with over 91 million people playing monthly. Retrieved from www.businessinsider.com/minecraft-has-74- million-monthly-players-2018-1. October 2018. Chapter 1 GettinG Started with Client Java
4 Figure 1-2. Minecraft server example from Tingsterland created by @tingsterchin5 Much of the success of Minecraft is through the large modding community who builds plugins that change the behavior of and enhance the game, taking it far beyond the original gameplay limitations. An example of a customer Minecraft server created by a young developer is shown in Figure 1-2. Java offers a great platform for building extensible applications through dynamic class loading and a secure sandbox model. Also with 12 million Java developers worldwide,6 there is no shortage of development expertise and talent. The Minecraft Java Edition is built entirely in Java using client technologies such as Swing and Java 2D and a Java gaming library called LWJGL. The high level of abstraction offered by Java and these libraries made it possible for Notch to develop Minecraft in a short period of time and support a variety of platforms without a large team of developers. 5 Screenshot from a Minecraft server running at https://tingsterland.com/ 6 Oracle Makes Developers More Productive with Latest Java Release. Retrieved from www. prnewswire.com/news-releases/oracle-makes-developers-more-productive-with-latest- java- release-300814269.html. March 2019. Chapter 1 GettinG Started with Client Java
5 An even easier 3D library to get started with is the built-in 3D support in JavaFX. You can find out more about 3D graphics in Chapter 8, “JavaFX 3D.” Mobile Conference Apps Java client technology is not just for the desktop. Using mobile JavaFX technology developed by Gluon,7 you can run your Java client on phones, tablets, and embedded devices like Raspberry Pi. Existing JavaFX applications can be ported directly to mobile devices with small changes in styling of controls to make them work on different screen sizes. For handling mobile-specific APIs, Gluon offers Gluon Attach, which provides cross-platform integration with hardware features. A great example of JavaFX mobile in action was the Devoxx conference application. This was originally built for the JavaOne conference in San Francisco and contributed to the open source community. The Devoxx conference picked it up and has done a great job extending it to be a general-purpose conference application that serves dozens of Devoxx and Voxxed conferences taking place around the world each year. 7 Official website for Gluon: https://gluonhq.com/ Chapter 1 GettinG Started with Client Java