Skip to Content
Java 9: Building Robust Modular Applications
book

Java 9: Building Robust Modular Applications

by Dr. Edward Lavieri, Peter Verhas, Jason Lee
April 2018
Intermediate to advanced content levelIntermediate to advanced
910 pages
33h 21m
English
Packt Publishing
Content preview from Java 9: Building Robust Modular Applications

Adding an image for the item

If the item has an image, we handle it in the same way that we did with the network icon image. This time, though, we actually wrap the ImageView in another HBox before adding it to the outer HBox. We do that so that we can add padding around the image (via picture.setPadding(new Insets()) to give this image some space between it and the network icon.

Finally, we create a Label to hold the item's body. We set the font size of the text to 20 points via label.setFont(Font.font(null, 20)), and add it to our HBox, which we then return to the caller, updateItem().

Any time you have a ListView, you are likely going to want a custom ListCell implementation like we have here. In some cases, calling toString() on the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 9 High Performance

Java 9 High Performance

Mayur Ramgir, Nick Samoylov
Distributed Computing in Java 9

Distributed Computing in Java 9

Raja Malleswara Rao Malleswara Rao Pattamsetti

Publisher Resources

ISBN: 9781788832823Supplemental ContentOtherPurchase LinkErrata Page