Book Image

Java 9 Programming Blueprints

By : Lee
Book Image

Java 9 Programming Blueprints

By: Lee

Overview of this book

Java is a powerful language that has applications in a wide variety of fields. From playing games on your computer to performing banking transactions, Java is at the heart of everything. The book starts by unveiling the new features of Java 9 and quickly walks you through the building blocks that form the basis of writing applications. There are 10 comprehensive projects in the book that will showcase the various features of Java 9. You will learn to build an email filter that separates spam messages from all your inboxes, a social media aggregator app that will help you efficiently track various feeds, and a microservice for a client/server note application, to name a few. The book covers various libraries and frameworks in these projects, and also introduces a few more frameworks that complement and extend the Java SDK. Through the course of building applications, this book will not only help you get to grips with the various features of Java 9, but will also teach you how to design and prototype professional-grade applications with performance and security considerations.
Table of Contents (13 chapters)
9
Taking Notes with Monumentum

Building the graphical user interface

For our GUI, we'd like to expose the same type of functionality as the command line, but, obviously, with a nice graphical interface. For this, we'll again reach for JavaFX. We'll give the user a means to select, using a chooser dialog, the directories to be searched, and a field by which to add the search patterns. Once the duplicates have been identified, we will display them in a list for the user to peruse. All of the duplicate groups will be listed and, when clicked, the files in that group will be displayed in another list. The user can right-click on the list and choose to either view the file (or files) or delete it (or them). When we are finished, the application will look like this:

Let's start by creating our project. In NetBeans, go to File | New Project and select Maven | JavaFX Application. You can name it...