Skip to main content
Top

2010 | Book

Beginning JavaFX™

insite
SEARCH

About this book

The open source JavaFX platform offers a Java-based approach to rich Internet application (RIA) development—an alternative to Adobe Flash/Flex and Microsoft Silverlight. At over 100 million downloads, JavaFX is poised to be a significant player.

Written by a JavaFX engineer and developer, this book is one of the first on the JavaFX platform to give you the following:

The fundamentals of JavaFX scripting on desktop and mobile platforms Examples of RIAs using JavaFX Graphics Media and animation using JavaFX

See how JavaFX gives you dynamic Java effects in your RIA development.

Table of Contents

Frontmatter
Chapter 1. Introduction to RIA
Abstract
Rich Internet Applications (RIAs) have always been about the user experience. RIAs, by (Wikipedia) definition, are web applications that have most of the characteristics of desktop applications, typically delivered through web-browser plug-ins or independently via sandboxes or virtual machines. The term RIA has many different definitions within the Internet development community, but all of those definitions boil down to enhancing the end-user experience in different ways. RIAs transfer the processing necessary for the user interface to the web client but keep the bulk of the data (maintaining the state of the program, its data, and so on) back in the application server, thus offering a better user experience with a lot more flare and pushing the boundaries of what we expect from the browser.
Chapter 2. Introduction to JavaFX
Abstract
As described by Sun, JavaFX is an expressive and rich client platform for creating and delivering immersive Internet experiences across different screens. The main intention of this technology is to write Rich Internet Applications (RIAs) that run seamlessly across screens (desktop, mobile, or IP TV), providing a uniform user experience. JavaFX applications are written using a statically typed, declarative language called JavaFX Script that makes it easy to program in a visual context, enabling developers to create highly expressive and intuitive GUIs quickly and easily.
Chapter 3. Data Types
Abstract
JavaFX Script is a statically typed language, in which the type is associated with the variable and not the value. Hence it is capable of detecting type errors at compile time and thus allows many type errors to be caught early in the development cycle. Static type checkers evaluate only the type information that can be determined at compile time, but they are able to verify that the checked conditions hold for all possible executions of the program, which eliminates the need to repeat type checks every time the program is executed. This makes execution and storage more efficient and optimized.
Chapter 4. Operators and Expressions
Abstract
An expression in a programming language is a combination of values, operators, variables and functions that are evaluated in a particular order of precedence to produce a value. An operator performs an operation on one or more operands to produce a value. In JavaFX Script, everything that is not a definition is an expression. This chapter describes the syntax, meaning, and the use of various expressions and operators in JavaFX Script.
Chapter 5. Functions
Abstract
A function is a block of statements enclosed within curly braces. This block is given a name and is invoked using the specified name.
Chapter 6. Class Definitions
Abstract
JavaFX Script is an object-oriented programming (OOP) language. Because it is built on the Java platform, JavaFX Script inherits almost all the features of Java, including those that support object orientation. We will start this chapter by examining some basic concepts of OOP, and later you will learn how to implement your own class in JavaFX Script.
Chapter 7. Access Specifiers
Abstract
An important aspect of object-oriented programming is data encapsulation (also called data hiding), whereby the implementation details of a class are kept hidden from the users of the class. Not only the implementation but also the data can be kept hidden from the user. Or one can choose to provide varying degrees of restricted access to those data members through functions.
Chapter 8. Inheritance
Abstract
Inheritance is a form of software reusability in which programmers create classes that “inherit” an existing class’s data and behaviors and enhance them with new capabilities. Software reusability saves time during application development. It also encourages the reuse of proven and debugged high-quality software, which increases the likelihood that a system will be implemented effectively. When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of the existing class. The existing class is called the base class, and the new class that is derived from the base class is called the derived class. In Java and the JavaFX scripting language, a base class is called a superclass and the derived class is called a subclass.
Chapter 9. Data Binding
Abstract
Binding is one of the most important, powerful and useful features of JavaFX; it can simplify your code to a great extent. In this chapter, we will start with basic binding concepts and proceed toward more sophisticated binding, with appropriate examples.
Chapter 10. Sequences
Abstract
A JavaFX Script sequence is a special kind of data structure that, like an array in Java, represents an ordered list of items of the same type. But unlike Java arrays, JavaFX Script sequences are not objects. Like arrays, however, they hold elements (individual items in the sequence) of the same type.
Chapter 11. Triggers
Abstract
A trigger is a block of code that is attached to a variable and executed whenever the value of the variable changes, including the assignment of the initial value. You can also optionally get hold of the old values that were replaced within the trigger. Triggers are very powerful and unique in JavaFX Script, just like bind. Triggers can be attached to normal variables as well as to sequences. First let us see how triggers work for simple variables and then proceed to complicated triggers and sequence triggers.
Chapter 12. Introduction to JavaFX UI Elements
Abstract
As you have learned, JavaFX is a rich client platform for creating and delivering immersive Internet experiences across different screens. So far, you have learned the JavaFX Script language capabilities and features and in this chapter, we will introduce you to various graphics APIs in JavaFX that help you build a rich Internet application. Before going into the actual APIs, you must understand how the APIs are classified in JavaFX. There are two broad categories of the APIs in JavaFX that you will learn in this chapter:
  • common profile
  • desktop profile
Chapter 13. Introduction to Animation
Abstract
Animation is one of the basic building blocks of any RIA, and any RIA technology need to have good animation support in order to deliver an immersive Internet experience to the end user. Animation adds liveliness to the content you are presenting and makes it far more expressive and interactive to the end user than static content.
Backmatter
Metadata
Title
Beginning JavaFX™
Authors
Lawrence Premkumar
Praveen Mohan
Copyright Year
2010
Publisher
Apress
Electronic ISBN
978-1-4302-7198-7
Print ISBN
978-1-4302-7199-4
DOI
https://doi.org/10.1007/978-1-4302-7198-7

Premium Partner