Unit 1: Java Reinforcement
1. Important Java concepts
In this part, we are going to have an overview of some important Java concepts that you should be familiar with. If you feel that you need to go more in depth with some of these concepts (or some others) regarding Java, you can have a look at the complete Java course.
Object Oriented Programming
Estimated time: 2,5 hours
- In these slides, you have a quick overview of some basic concepts regarding OOP: how to define classes and objects in Java, and the different relationships between classes: associations, inheritance…
- Here you can find the proposed exercises associated to the slides.
Collection management
Estimated time: 2 hours
- In these slides, you have a quick overview of some concepts regarding collections: lists, maps, trees and so on.
- Here you can find the proposed exercises associated to the slides.
I/O management
Estimated time: 2,5 hours
- In these slides, you have a quick overview of how to deal with text files and the filesystem in Java.
- Here you can find the proposed exercises associated to the slides.
2. Functional programming
In this part, we are going to learn some concepts regarding functional programming, a declarative paradigm to face some programs.
Lambda expressions
Estimated time: 1 hour
- In this document, you have a quick overview of what functional programming is, and its main principles.
- In this document, you can learn about lambda expressions. What they are and how to implement them in Java. Do Exercises 1 and 2 to practice with these expressions.
Stream management
Estimated time: 2 hours
- In this document, you will learn how to manage collections with streams. There are some basic concepts regarding intermediary and final operations with streams, that you can practice with Exercises 1 and 2. Then, you can get more in depth with some advanced concepts and Exercise 3.
3. JavaFX application development
In this part, we are going to learn how to implement GUIs (Graphical User Interfaces) using JavaFX.
JavaFX fundamentals
- In this document, you have a quick overview about how to create JavaFX projects from IntelliJ, and how to run and test your first project, including the additional software that you may need to install and setup.
- Once that you have setup JavaFX in IntelliJ, in this document you have an overview of the most important elements in JavaFX applications: you will read about the different containers and controls available in JavaFX, how to place them in our application, and how to synchronize them with our Java code. You have Exercises 1 and 2 to start placing components in different applications. Then, you will learn how to manage events to respond to user interaction. Exercises 3 to 6 help you create JavaFX applications including events (Exercise 3 is a YouTube tutorial to implement a simple calculator using JavaFX). Finally, you will learn some additional elements, such as dialogs, to show popups or alerts to the user. Exercises 7 and 8 let you practice with these dialogs.
Advanced JavaFX features
- In this document, you will learn some advanced concepts regarding JavaFX applications, although some of them will not be explained in class:
- First of all, you will learn how to add a window closing event to our application, to prevent user from closing without saving changes.
- Next section talks about how to add CSS styles to our JavaFX application. This section will not be explained in class.
- Section 3 is a really important one. It shows how to develop applications with multiple views, and how to swap views in the same stage, or between different stages. Exercise 2 lets you practice with this concept.
- Section 4 explains how to add different charts to our applications. Exercise 3 is a simple exercise to add a bar chart.
- Section 5 shows how to use some advanced controls, such as tables, which are an important element in applications that need to show large amounts of information. We will also learn how to work with dates and images in JavaFX applications.
- Finally, section 6 is a step-by-step project to practice with some of the most important concepts seen so far. Try to follow the steps given to build the HealthyMenu application. You can also follow this video to complete it. Then, do Exercise 4 to finish it.
- Optionally, there’s an additional section that explains how to add animations to JavaFX projects. We are not going to cover this section in class.