Java Reference
In-Depth Information
How It Works
The new Streams API enhances the usability of Java Collection types, making it easy
to iterate and perform tasks against each element in the collection. In the solution to
this recipe, an array of strings is generated, and then a stream is created from the array.
Using the stream, each element of the array is printed to the command-line via the
forEach() terminal operation. The Streams API allows the compiler to determine
the best way to iterate over a collection (internal iteration). A stream is a sequence of
object references that can be generated on all collection types. The Streams API makes
it possible to perform a sequence of aggregate operations on those object references
and return a result or apply the changes to the objects inline. This is otherwise known
as a pipeline . The pseudocode for generating and using a stream is as follows:
Collection -> (Stream) -> (Zero or More Intermediate
Operations) -> (Terminal Operation)
For more information on this outstanding new feature of Java 8, refer to Recipe
7-8.
JavaFX
JavaFX has undergone a massive overhaul with the release of Java 8. For starters, it is
now included with Java 8 SE, so there is no longer a need to download it separately.
Multiple new components have been added to the platform, including a DatePicker
and new SwingNode for embedding Swing inside of JavaFX. There is also better em-
bedded support for deployment on platforms such as the Raspberry Pi. Other new fea-
tures include WebView enhancements, printing support, rich text support, and the list
goes on.
This section covers just a few of the new features for JavaFX 8. To learn more,
refer to Chapters 14 - 17 , which are dedicated to JavaFX.
2-9. Embedding Swing in JavaFX
Problem
Search WWH ::




Custom Search