ebook img

Pro JavaFX 8 a definitive guide to building desktop, mobile, and embedded java clients PDF

604 Pages·2014·11.419 MB·English
by  VosJohan
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Pro JavaFX 8 a definitive guide to building desktop, mobile, and embedded java clients

BOOKS FOR PROFESSIONALS BY PROFESSIONALS® Vos Gao Chin Iverson Weaver Pro JavaFX 8 RELATED In Pro JavaFX 8, expert authors show you how to use the JavaFX platform to create rich-client Java applications. You’ll discover how you can use this powerful Java-based UI platform, which is capable of handling large-scale data-driven business applications for PC as well as mobile and embedded devices. Covering the JavaFX API, development tools, and best practices, this book provides code examples that explore the exciting new features provided with JavaFX 8 which comes as part of Oracle’s new Java (SE) 8 release. This book also contains engaging tutorials that cover virtually every facet of JavaFX development as well as reference materials on JavaFX that augment the JavaFX API documentation. After reading and using this book, you’ll have the authoritative knowledge that should give you an edge in your next JavaFX-based application projects for your job or your clients. You’ll learn: (cid:115)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:71)(cid:69)(cid:84)(cid:0)(cid:83)(cid:84)(cid:65)(cid:82)(cid:84)(cid:69)(cid:68)(cid:0)(cid:87)(cid:73)(cid:84)(cid:72)(cid:0)(cid:42)(cid:65)(cid:86)(cid:65)(cid:38)(cid:56)(cid:12)(cid:0)(cid:73)(cid:78)(cid:67)(cid:76)(cid:85)(cid:68)(cid:73)(cid:78)(cid:71)(cid:0)(cid:68)(cid:79)(cid:87)(cid:78)(cid:76)(cid:79)(cid:65)(cid:68)(cid:73)(cid:78)(cid:71)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:51)(cid:36)(cid:43)(cid:0)(cid:65)(cid:78)(cid:68)(cid:0)(cid:65)(cid:86)(cid:65)(cid:73)(cid:76)(cid:65)(cid:66)(cid:76)(cid:69)(cid:0)(cid:84)(cid:79)(cid:79)(cid:76)(cid:83) (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:69)(cid:88)(cid:80)(cid:82)(cid:69)(cid:83)(cid:83)(cid:0)(cid:85)(cid:83)(cid:69)(cid:82)(cid:0)(cid:73)(cid:78)(cid:84)(cid:69)(cid:82)(cid:70)(cid:65)(cid:67)(cid:69)(cid:83)(cid:0)(cid:87)(cid:73)(cid:84)(cid:72)(cid:0)(cid:51)(cid:67)(cid:69)(cid:78)(cid:69)(cid:34)(cid:85)(cid:73)(cid:76)(cid:68)(cid:69)(cid:82)(cid:0)(cid:65)(cid:78)(cid:68)(cid:0)(cid:38)(cid:56)(cid:45)(cid:44) (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:85)(cid:83)(cid:69)(cid:0)(cid:80)(cid:82)(cid:79)(cid:80)(cid:69)(cid:82)(cid:84)(cid:89)(cid:0)(cid:66)(cid:73)(cid:78)(cid:68)(cid:73)(cid:78)(cid:71)(cid:0)(cid:84)(cid:79)(cid:0)(cid:75)(cid:69)(cid:69)(cid:80)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:53)(cid:41)(cid:0)(cid:69)(cid:65)(cid:83)(cid:73)(cid:76)(cid:89)(cid:0)(cid:73)(cid:78)(cid:0)(cid:83)(cid:89)(cid:78)(cid:67)(cid:0)(cid:87)(cid:73)(cid:84)(cid:72)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:77)(cid:79)(cid:68)(cid:69)(cid:76) (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:85)(cid:83)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:82)(cid:73)(cid:67)(cid:72)(cid:0)(cid:83)(cid:69)(cid:84)(cid:0)(cid:79)(cid:70)(cid:0)(cid:42)(cid:65)(cid:86)(cid:65)(cid:38)(cid:56)(cid:0)(cid:53)(cid:41)(cid:0)(cid:67)(cid:79)(cid:78)(cid:84)(cid:82)(cid:79)(cid:76)(cid:83)(cid:12)(cid:0)(cid:67)(cid:72)(cid:65)(cid:82)(cid:84)(cid:83)(cid:12)(cid:0)(cid:83)(cid:72)(cid:65)(cid:80)(cid:69)(cid:83)(cid:12)(cid:0)(cid:69)(cid:70)(cid:70)(cid:69)(cid:67)(cid:84)(cid:83)(cid:12)(cid:0) transformations, and animations to create stunning, responsive, user interfaces (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:85)(cid:83)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:80)(cid:79)(cid:87)(cid:69)(cid:82)(cid:70)(cid:85)(cid:76)(cid:0)(cid:42)(cid:65)(cid:86)(cid:65)(cid:38)(cid:56)(cid:0)(cid:76)(cid:65)(cid:89)(cid:79)(cid:85)(cid:84)(cid:0)(cid:67)(cid:76)(cid:65)(cid:83)(cid:83)(cid:69)(cid:83)(cid:0)(cid:84)(cid:79)(cid:0)(cid:68)(cid:69)(cid:70)(cid:73)(cid:78)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:85)(cid:83)(cid:69)(cid:82)(cid:0)(cid:73)(cid:78)(cid:84)(cid:69)(cid:82)(cid:70)(cid:65)(cid:67)(cid:69)(cid:0) in a cross-platform fashion (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:76)(cid:69)(cid:86)(cid:69)(cid:82)(cid:65)(cid:71)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:79)(cid:66)(cid:83)(cid:69)(cid:82)(cid:86)(cid:65)(cid:66)(cid:76)(cid:69)(cid:0)(cid:67)(cid:79)(cid:76)(cid:76)(cid:69)(cid:67)(cid:84)(cid:73)(cid:79)(cid:78)(cid:0)(cid:67)(cid:76)(cid:65)(cid:83)(cid:83)(cid:69)(cid:83)(cid:0)(cid:84)(cid:79)(cid:0)(cid:79)(cid:66)(cid:83)(cid:69)(cid:82)(cid:86)(cid:69)(cid:0)(cid:67)(cid:72)(cid:65)(cid:78)(cid:71)(cid:69)(cid:83)(cid:0)(cid:73)(cid:78)(cid:12)(cid:0) and bind to, Java collections (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:85)(cid:83)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:42)(cid:65)(cid:86)(cid:65)(cid:38)(cid:56)(cid:0)(cid:77)(cid:69)(cid:68)(cid:73)(cid:65)(cid:0)(cid:67)(cid:76)(cid:65)(cid:83)(cid:83)(cid:69)(cid:83)(cid:0)(cid:84)(cid:79)(cid:0)(cid:80)(cid:76)(cid:65)(cid:89)(cid:0)(cid:65)(cid:85)(cid:68)(cid:73)(cid:79)(cid:0)(cid:65)(cid:78)(cid:68)(cid:0)(cid:86)(cid:73)(cid:68)(cid:69)(cid:79) (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:73)(cid:78)(cid:84)(cid:69)(cid:82)(cid:65)(cid:67)(cid:84)(cid:0)(cid:87)(cid:73)(cid:84)(cid:72)(cid:0)(cid:69)(cid:88)(cid:84)(cid:69)(cid:82)(cid:78)(cid:65)(cid:76)(cid:0)(cid:65)(cid:80)(cid:80)(cid:76)(cid:73)(cid:67)(cid:65)(cid:84)(cid:73)(cid:79)(cid:78)(cid:0)(cid:83)(cid:69)(cid:82)(cid:86)(cid:73)(cid:67)(cid:69)(cid:83)(cid:0)(cid:84)(cid:79)(cid:0)(cid:67)(cid:82)(cid:69)(cid:65)(cid:84)(cid:69)(cid:0)(cid:65)(cid:78)(cid:0)(cid:69)(cid:78)(cid:84)(cid:69)(cid:82)(cid:80)(cid:82)(cid:73)(cid:83)(cid:69)(cid:0) application with JavaFX (cid:115)(cid:0)(cid:0)(cid:40)(cid:79)(cid:87)(cid:0)(cid:84)(cid:79)(cid:0)(cid:85)(cid:83)(cid:69)(cid:0)(cid:84)(cid:72)(cid:69)(cid:0)(cid:42)(cid:65)(cid:86)(cid:65)(cid:38)(cid:56)(cid:0)(cid:33)(cid:48)(cid:41)(cid:0)(cid:87)(cid:73)(cid:84)(cid:72)(cid:0)(cid:65)(cid:76)(cid:84)(cid:69)(cid:82)(cid:78)(cid:65)(cid:84)(cid:73)(cid:86)(cid:69)(cid:0)(cid:76)(cid:65)(cid:78)(cid:71)(cid:85)(cid:65)(cid:71)(cid:69)(cid:83)(cid:0)(cid:83)(cid:85)(cid:67)(cid:72)(cid:0)(cid:65)(cid:83)(cid:0)(cid:51)(cid:67)(cid:65)(cid:76)(cid:65)(cid:0)(cid:65)(cid:78)(cid:68)(cid:0)(cid:39)(cid:82)(cid:79)(cid:79)(cid:86)(cid:89) Shelve in ISBN 978-1-4302-6574-0 Programming Languages/Java 54999 User level: Intermediate–Advanced SOURCE CODE ONLINE 9781430265740 www.apress.com For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance About the Authors ...............................................................................................................xv About the Technical Reviewer ..........................................................................................xvii Acknowledgments ............................................................................................................xix Foreword ...........................................................................................................................xxi Introduction .....................................................................................................................xxiii (cid:78) Chapter 1: Getting a Jump Start in JavaFX .......................................................................1 (cid:78) Chapter 2: Creating a User Interface in JavaFX ...............................................................31 (cid:78) Chapter 3: Using SceneBuilder to Create a User Interface ..............................................79 (cid:78) Chapter 4: Properties and Bindings ...............................................................................143 (cid:78) Chapter 5: Building Dynamic UI Layouts in JavaFX ......................................................187 (cid:78) Chapter 6: Using the JavaFX UI Controls .......................................................................229 (cid:78) Chapter 7: Collections and Concurrency .......................................................................271 (cid:78) Chapter 8: Creating Charts in JavaFX ............................................................................349 (cid:78) Chapter 9: Using the Media Classes ..............................................................................377 (cid:78) Chapter 10: JavaFX 3D ..................................................................................................429 (cid:78) Chapter 11: Accessing Web Services ............................................................................491 (cid:78) Chapter 12: JavaFX on Embedded and Mobile ..............................................................525 (cid:78) Chapter 13: JavaFX Languages and Markup .................................................................549 Index .................................................................................................................................579 iii Introduction As a developer, author, speaker, and advocate for JavaFX since its inception in 2007, I am very excited about JavaFX 8. It was released in March 2014 as an integral part of Java SE 8, and is the successor to Java Swing. As you’ll read in the pages of this book, JavaFX runs on desktops (Mac, Windows, Linux), as well as embedded devices such as the Raspberry Pi. As the Internet of things (IoT) is increasingly realized, JavaFX is well positioned to enable the user interface of IoT. Also, because of community projects led by folks such as Johan Vos and Niklas Therning, developers are deploying JavaFX apps on Android and iOS devices. The JavaFX community has many talented, passionate, and cordial developers, and I count it a privilege to call them my colleagues. One such colleague, Johan Vos, is a coauthor of our Pro JavaFX 2 book, and is the lead author of this Pro JavaFX 8 book. It has been my pleasure to continue working with Johan on this book under his leadership. Please join me in welcoming and congratulating him in this role, perhaps by tweeting him at @JohanVos or posting a review of this book on Amazon. It is my hope that you’ll find this book both enjoyable and instrumental in helping you learn JavaFX! —James L. Weaver Java Technology Ambassador Oracle Corporation xxiii CHAPTER 1 Getting a Jump Start in JavaFX Don’t ask what the world needs. Ask what makes you come alive, and go do it. Because what the world needs is people who have come alive. —Howard Thurman At the annual JavaOne conference in May 2007, Sun Microsystems announced a new product family named JavaFX. Its stated purpose includes enabling the development and deployment of content-rich applications on consumer devices such as cell phones, televisions, in-dash car systems, and browsers. Josh Marinacci, a software engineer at Sun, made the following statement, very appropriately, in a Java Posse interview: “JavaFX is sort of a code word for reinventing client Java and fixing the sins of the past.” He was referring to the fact that Java Swing and Java 2D have lots of capability, but are also very complex. By using FXML, JavaFX allows us to simply and elegantly express user interfaces (UIs) with a declarative programming style. It also leverages the full power of Java, because you can instantiate and use the millions of Java classes that exist today. Add features such as binding the UI to properties in a model and change listeners that reduce the need for setter methods, and you have a combination that will help restore Java to the client-side Internet applications. In this chapter, we give you a jump start in developing JavaFX applications. After bringing you up to date on the brief history of JavaFX, we show you how to get the required tools. We also explore some great JavaFX resources and walk you through the process of compiling and running JavaFX applications. In the process you’ll learn a lot about the JavaFX application programming interface (API) as we walk through application code together. A Brief History of JavaFX JavaFX started life as the brainchild of Chris Oliver when he worked for a company named SeeBeyond. They had a need for richer user interfaces, so Chris created a language that he dubbed F3 (Form Follows Function) for that purpose. In the article “Mind-Bendingly Cool Innovation” (cited in the Resources section at the end of this chapter), Chris is quoted as follows: “When it comes to integrating people into business processes, you need graphical user interfaces for them to interact with, so there was a use case for graphics in the enterprise application space, and there was an interest at SeeBeyond in having richer user interfaces.” SeeBeyond was acquired by Sun, who subsequently changed the name of F3 to JavaFX, and announced it at JavaOne 2007. Chris Oliver joined Sun during the acquisition and continued to lead the development of JavaFX. The first version of JavaFX Script was an interpreted language, and was considered a prototype of the compiled JavaFX Script language that was to come later. Interpreted JavaFX Script was very robust, and there were two JavaFX books published in the latter part of 2007 based on that version. One was written in Japanese, and the other was written in English and published by Apress (JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-Side Applications, Apress, 2007). While developers were experimenting with JavaFX and providing feedback for improvement, the JavaFX Script compiler team at Sun was busy creating a compiled version of the language. This included a new set of runtime API libraries. The JavaFX Script compiler project reached a tipping point in early December 2007, which 1 CHAPTER 1 (cid:78) GETTING A JUMP START IN JAVAFX was commemorated in a blog post entitled “Congratulations to the JavaFX Script Compiler Team—The Elephant Is Through the Door.” That phrase came from the JavaFX Script compiler project leader Tom Ball in a blog post, which contained the following excerpt. An elephant analogy came to me when I was recently grilled about exactly when the JavaFX Script compiler team will deliver our first milestone release. “I can’t give you an accurate date,” I said. “It’s like pushing an elephant through a door; until a critical mass makes it past the threshold you just don’t know when you’ll be finished. Once you pass that threshold, though, the rest happens quickly and in a manner that can be more accurately predicted.” A screenshot of the silly, compiled JavaFX application written by one of the authors, Jim Weaver, for that post is shown in Figure 1-1, demonstrating that the project had in fact reached the critical mass to which Tom Ball referred. Figure 1-1. Screenshot for the “Elephant Is Through the Door” program Much progress continued to be made on JavaFX in 2008: (cid:117)(cid:0) The NetBeans JavaFX plug-in became available for the compiled version in March 2008. (cid:117)(cid:0) Many of the JavaFX runtime libraries (mostly focusing on the UI aspects of JavaFX) were rewritten by a team that included some very talented developers from the Java Swing team. (cid:117)(cid:0) In July 2008, the JavaFX Preview Software Development Kit (SDK) was released, and at JavaOne 2008, Sun announced that the JavaFX 1.0 SDK would be released in fall 2008. (cid:117)(cid:0) On December 4, 2008, the JavaFX 1.0 SDK was released. This event increased the adoption rate of JavaFX by developers and IT managers because it represented a stable codebase. (cid:117)(cid:0) In April 2009, Oracle and Sun announced that Oracle would be acquiring Sun. The JavaFX 1.2 SDK was released at JavaOne 2009. (cid:117)(cid:0) In January 2010, Oracle completed its acquisition of Sun. The JavaFX 1.3 SDK was released in April 2010, with JavaFX 1.3.1 being the last of the 1.3 releases. 2 CHAPTER 1 (cid:78) GETTING A JUMP START IN JAVAFX At JavaOne 2010, JavaFX 2.0 was announced. The JavaFX 2.0 roadmap was published by Oracle and included items such as the following. (cid:117)(cid:0) Deprecate the JavaFX Script language in favor of using Java and the JavaFX 2.0 API. This brings JavaFX into the mainstream by making it available to any language (e.g., Java, Groovy, and JRuby) that runs on the Java Virtual Machine (JVM). As a consequence, existing developers do not need to learn a new language, but they can use existing skills and start developing JavaFX applications. (cid:117)(cid:0) Make the compelling features of JavaFX Script, including binding to expressions, available in the JavaFX 2.0 API. (cid:117)(cid:0) Offer an increasingly rich set of UI components, building on the components already available in JavaFX 1.3. (cid:117)(cid:0) Provide a Web component for embedding HTML and JavaScript content into JavaFX applications. (cid:117)(cid:0) Enable JavaFX interoperability with Swing. (cid:117)(cid:0) Rewrite the media stack from the ground up. JavaFX 2.0 was released at JavaOne 2011, and has enjoyed a greatly increased adoption rate due to the innovative features articulated previously. JavaFX 8 marks another important milestone. JavaFX is now an integral part of the Java Platform, Standard Edition. (cid:117)(cid:0) This is a clear indication that JavaFX is considered mature enough, and that it is the future of Java on the client. (cid:117)(cid:0) This greatly benefits developers, as they don’t have to download two SDKs and tool suites. (cid:117)(cid:0) The new technologies in Java 8, in particular the Lambda expressions, Stream API, and default interface methods, are very usable in JavaFX. (cid:117)(cid:0) Many new features have been added, including native 3D support, a printing API, and some new controls including a datepicker. Now that you’ve had the obligatory history lesson in JavaFX, let’s get one step closer to writing code by showing you where some examples, tools, and other resources are. Prepare Your JavaFX Journey Required Tools Because JavaFX is now part of Java, you don’t have to download a separate JavaFX SDK. The whole JavaFX API and implementation is part of the Java 8 SE SDK that can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/index.html. This SDK contains everything you need to develop, run, and package JavaFX applications. You can compile JavaFX applications using command-line tools contained in the Java 8 SE SDK. Most developers, however, prefer an integrated development environment (IDE) for increased productivity. By definition, an IDE that supports Java 8 also supports JavaFX 8. Hence, you can use your favorite IDE and develop JavaFX applications. In this book, we mainly use the NetBeans IDE, as it allows for a tighter integration with SceneBuilder (see the next paragraph). The NetBeans IDE can be downloaded from https://netbeans.org/downloads. 3 CHAPTER 1 (cid:78) GETTING A JUMP START IN JAVAFX SceneBuilder is a stand-alone tool that allows you to design JavaFX interfaces rather than coding them. We discuss SceneBuilder in Chapter 3. Although SceneBuilder produces FXML—and we discuss FXML in Chapter 3 as well—that can be used in any IDE, NetBeans provides a tight integration with SceneBuilder. The SceneBuilder tool can be downloaded at http://www.oracle.com/technetwork/java/javase/downloads/sb2download-2177776.html. JavaFX, the Community JavaFX is not a closed-source project, developed in a secret bunker. To the contrary, JavaFX is being developed in an open spirit, with an open source code base, open mailing lists, and an open and active community sharing knowledge. The source code is developed in the OpenJFX project, which is a subproject of the OpenJDK project in which Java SE is being developed. If you want to examine the source code or the architecture, or if you want to read the technical discussions on the mailing list, have a look at http://openjdk.java.net/projects/openjfx. The developer community is very active, both in OpenJFX as well as in application-specific areas. The starting point for developers is the JavaFX Community at http://javafxcommunity.com. This is a community site created by Oracle, but with input from many JavaFX developers. The content of the JavaFX Community changes often, and in Figure 1-2 we show a snapshot on how this community site looked at the time of writing. Figure 1-2. A snapshot of the JavaFX community web site 4 CHAPTER 1 (cid:78) GETTING A JUMP START IN JAVAFX In addition, blogs maintained by JavaFX engineers and developers are great resources for up-to-the-minute technical information on JavaFX. For example, Oracle JavaFX Engineers Richard Bair, Jasper Potts, and Jonathan Giles keep the developer community apprised of the latest JavaFX innovations at http://fxexperience.com. The Resources section at the end of this chapter contains the URLs of the blogs that the authors of this book use to engage the JavaFX developer community. Two important characteristics of the JavaFX Community are its own creativity and the desire to share. There are a number of open-source efforts bringing added value to the JavaFX Platform. Because of good cooperation between the JavaFX Platform engineers and the external JavaFX developers, these open-source projects fit very well with the official JavaFX Platform. Some of the most interesting efforts are listed here: (cid:117)(cid:0) RoboVM allows you to create iOS applications using Java and JavaFX. As a consequence, your JavaFX application can be used to create an app for the iPhone or the iPad. (cid:117)(cid:0) The JavaFX-Android project maintains a JavaFX SDK for Android development. As a consequence, your JavaFX application can be used to create an app for Android devices. The iOS and the Android port of JavaFX are discussed in more detail in Chapter 12. (cid:117)(cid:0) JFXtras.org is a project working on adding high-quality controls and add-ons to the JavaFX Platform. (cid:117)(cid:0) ControlsFX is another project adding high-quality controls and tools to the JavaFX Platform. It is worth mentioning that the JavaFX team is closely watching the efforts in both JFXtras.org and ControlsFX, and ideas that are started in one of those projects might make it into one of the next releases of JavaFX. (cid:117)(cid:0) DataFX is an open-source project aiming to facilitate the retrieval of external data in JavaFX applications, and to provide JavaFX developers with enterprise functionality like injection and flow management. (cid:117)(cid:0) OpenDolphin is another project helping developers in separating and synchronizing client and server development, by implementing the highest degree of Model-View-Controller separation. Take a few minutes to explore these sites. Next we point out some more valuable resources that are helpful. Use the Official Specifications While developing JavaFX applications, it is very useful to have access to the API JavaDoc documentation, which is available at http://download.java.net/jdk8/jfxdocs/index.html and shown in Figure 1-3. 5 CHAPTER 1 (cid:78) GETTING A JUMP START IN JAVAFX Figure 1-3. JavaFX SDK API Javadoc The API documentation in Figure 1-3, for example, shows how to use the Rectangle class, located in the javafx.scene.shape package. Scrolling down this web page shows the properties, constructors, methods, and other helpful information about the Rectangle class. By the way, this API documentation is available in the Java 8 SE SDK that you downloaded, but we wanted you to know how to find it online as well. Apart from the JavaDoc, it is very useful to have the Cascading Style Sheets (CSS) style reference at hand as well. This document explains all the style classes that can be applied to a particular JavaFX element. You can find this document at http://download.java.net/jdk8/jfxdocs/javafx/scene/doc-files/cssref.html. ScenicView You already downloaded SceneBuilder, which is the tool that allows you to create UIs by designing them, rather than writing code. We expect that there will be more tools developed by companies and individuals that help you create JavaFX applications. One of the first tools that was made available for free and that is very helpful when debugging JavaFX applications is ScenicView, originally created by Amy Fowler at Oracle, and later maintained by Jonathan Giles. You can download ScenicView at http://fxexperience.com/scenic-view/. ScenicView is particularly helpful because it provides a convenient UI that allows developers to inspect properties of nodes (i.e., dimensions, translations, CSS) at runtime. Packaging and Distribution The techniques used for delivering software to the end user are always changing. In the past, the preferred way for delivering Java applications was via the Java Network Launch Protocol (JNLP). Doing so, both applets and stand-alone applications can be installed on a client. However, there are a number of issues with this technique. The idea only 6

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.