Introduction to JavaFX development
4.0 (2 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
31 students enrolled

Introduction to JavaFX development

Build a fully featured TFTP client using JavaFX
4.0 (2 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
31 students enrolled
Created by John McNeil
Last updated 5/2018
English [Auto-generated]
Current price: $64.99 Original price: $99.99 Discount: 35% off
1 day left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 6 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Build a JavaFX application
  • Use SceneBuilder to create a user interface
  • How to link your UI objects to Java objects
  • How to create text, text areas and drop down options
  • How to layout objects for a consistent presentation
  • How to connect to a server, initiate and complete an exchange
  • Provide user feedback via your user interface
  • How to include JavaFX into your Eclipse development environment
  • How to send and receive Universal Data Packages (UDP)
Course content
Expand all 32 lectures 04:15:27
+ Introduction to the Trivial File Transfer Client
1 lecture 04:23

A look at the application you will have at the end of the course and a chance to see it in action.

Preview 04:23
+ The Trivial File Transfer Protocol
4 lectures 18:55

A look at what exactly what the Trivial File Transfer Process is so that we know what we are trying to build. 

What is TFTP

How information is exchanged between the server and the client.

The transfer mechanism

A look at how to request a conversation from a TFTP server.

Establishing communication

How TFTP manages the transfer of the file data.  The video looks at the roles of the client and the server when sending or receiving information from the client.  The types of message that are supported by TFTP as well as how to structure the packets of data ready for transmission.

Data transfer mechanics
+ Designing our application
2 lectures 11:43

In the previous section we learnt about what TFTP is and how it works.  With this understanding we now look at what information we will need to provide in order to communicate with a server.  From this we can sketch out what information we need to collect using our application interface.  Once we understand this we are able to sketch out how we want our application to look.

The client user interface

Now we know what we want our application to look like, we need to take a look at what else our application needs and how we are going to link all these bits together.  The video covers the structure of JavaFX as well as the class structure for the various components of the application.  The application makes use of Model-View-Control (MVC) approach as well as a custom message event which is fired from the TFTP engine.  All of these classes will be hand build as part of the course so this video introduces the student to the function of each class and how they relate to one another. 

Structuring the application
+ Front end coding
10 lectures 01:31:33

This video covers the software and tools required to complete the coding side of the course.  The student is shown where to find the software and how to install.  There is some configuration of Eclipse so that it can locate SceneBuilder which is explained. Also, Eclipse requires either a plugin for JavaFX or a version of Eclipse with JavaFX already installed.  Both of these options are covered, allowing the Student to adopt the approach that best suits their situation.

Setting up your environment

Creating a JavaFX project in Eclipse ready for building the application.

Preview 02:24

A review of what our application user interface needs to have and do ready to actually start building.

Preview 03:26

Creating the FXML document within Eclipse ready to use with SceneBuilder.

Creating the FXML scene

Open SceneBuilder from the FXML file in Eclipse.  The video walks through SceneBuilder so you can find your way around.  Finally we use SceneBuilder to build our application interface to match our mock up.

Using SceneBuilder to create the UI

Creating the main entry point for our application and running the application to see our user interface.

Launching our application

Adding a controller class for our user interface.  The controller is used to set the options for the drop down lists, set tool-tips for fields, set a default value for the drop down lists and place the cursor in the top field ready to capture input.

Adding a UI controller

Linking our buttons on our user interface with to our controller class.  Getting the 'Clear' button to clear the values in the fields and the 'Go' button to simply print a console message until we have built the engine.

Handling events

Checking that the required fields are completed correctly otherwise highlight the issue to the user and allow them to correct the issue before proceeding with the requested action. 

Validating fields

Creating the Message Event class which we will use to notify our client of events generated from our TFTP engine.  Also creating the message listener interface which our user interface controller class will need to implement.

Status messages
+ Back end coding
13 lectures 01:58:53

Explains how we will manage the conversation with the server.  Starting with the initial call to the engine and going all the way through to completion of the transfer including how the process will tidy up after itself so we avoid leaving open file connections or network socket connections.  Creates the engine class which we will go on to extend to manage all the server conversations.

Managing the file transfer

Adding the generic features to allow the engine class to fire off events and notify any objects which have listened as a listener.

Generating messages

Creating the entry point method for starting a file transfer with a TFTP server. Receives the field values from the user interface, sorting them in class properties and then calls the next method in the chain.

Kicking off the file transfer

Creates a temporary file to use with the file transfer.

transfer using a temporary file

Explains how we are going to initiate a call to the TFTP server informing the server of the ip number and port to use when sending messages back to us.

Initiate the server overview

Builds up  the Initiate method which is responsible for making the initial call to the TFTP server passing it the client ip number and port which the server should use when responding.  Covers building the byte array containing the request,wrapping the byte array in a Datagram packet and sending the packet to the server using the UDP socket.

Initiate server request code

This video looks at how we will manage the conversation with the TFTP server when we are sending a file to the server.  This looks at the key actions we take which includes the code for the method which manages the transfer.  Here we cover the exchange of information between the client and the server when send a file.

Sending file to the server

We introduce a new class which allows us to break down a data packet of information into its individual parts and easily access the component parts.  This is used by other methods when examining the data packet send from the server.

Data Packet Class

We introduce yet one more class the allows us to easily convert end of line markers for text files between NETASCII and those ine terminators used by Windows, Mac and Linux.

Data Parser Class

The methods covered in this video are part of the engine class.  They deal with accessing the source file we wish to send, handle the conversion between the text formats supported and make use of the DataParser class.  Creates a temporary file with the data we wish to send, converted if required.

Convert File

In this video we read the data from the server and providing there is no error, we build the data we wish to send to the server. As this section is all about send a file to the server we are building a data packet and receiving acknowledgement messages.  This video pulls together the all the previous parts of send a file to the server.

Build Data

This video looks at how we will manage the conversation with the TFTP server when receiving a file from the server.  This looks at the key actions we take which includes the code for the method which manages the transfer.  Here we cover the exchange of information between the client and the server when receiving a file.  This method makes use of many of the components used in sending a file to the server as well as using a similar approach so it will be familiar to the student.

Receiving files from the server

Earlier on we created a method to build data packets to send to the server. In this video we look at how we build acknowledgement packets to let the server know we have received the data packet sent to us. This completes the code for our engine class to send and receive files with a TFTP server.

Acknowledging Receipt
+ Putting It All Together
2 lectures 10:00

In order to test our application we need a TFTP server to call. In this video we will install a freely available TFTP server that we can then use to test our TFTP client.

Installing TFTP Test Server

Here in the last video we use our TFTP client to download an ascii file from the server and upload a binary file to the server.  We can see from the file locations used by the server and client that the files have been transferred as well as the commentary within the server and eclipse consoles, not to mention our status field in our application.

Using The Application
  • Some knowledge of Java would be beneficial or at least an interest in programming
  • JavaSE 8 or above (freely available)
  • Eclipse 4.4 or above (freely available)
  • SceneBuilder 8 (freely available)
  • TFTP server with which to interact with (freely available)

I wanted to do a tutorial on JavaFX.  The idea, as always with me, was to show how to build a real application in JavaFX.  I wanted it to be a real solution not a series of examples of what you can do.  I wanted to build something that could be used, something that served a purpose.

So, I searched around and found a specification document.  This specification describes how to implement what is known as a Trivial File Transfer Protocol (TFTP).  This is described as a simplified version of the File Transfer Protocol specification, used to move files between machines, so is ideal to use as an example.  There are two parts to this, a client and a server so, for our JavaFX tutorial we will build a TFTP client.  There are also TFTP servers freely available so we have a server that we can test our client against.

How the course is structured:

The course is split into 5 sections from setting up through to packaging it all up.  Along the way we look at designing and building the front end, pulling together the logic for the backend and linking the parts together. 

Delivery of course content is primarily through the use of video sessions demonstrating a specific point. As you go through the sections you can run the application and see how it develops and builds on the previous sections.

At the end of the course you will be able to take the techniques covered in the course and apply these to your own development projects

Who this course is for:
  • Anyone who knows the basics of Java.
  • Anyone who wants to develop their Java knowledge and learn JavaFX.
  • Anyone who wants to move from following examples to designing and building their own applications.