From 0 to 1: JavaFX and Swing for Awesome Java UIs
4.3 (59 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
3,203 students enrolled
Wishlisted Wishlist

Please confirm that you want to add From 0 to 1: JavaFX and Swing for Awesome Java UIs to your Wishlist.

Add to Wishlist

From 0 to 1: JavaFX and Swing for Awesome Java UIs

An intensely practical, comprehensive and quirky look at JavaFX and Swing. Instructors are ex-Google, Stanford.
4.3 (59 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
3,203 students enrolled
Created by Loony Corn
Last updated 11/2016
English [Auto-generated]
Current price: $12 Original price: $50 Discount: 76% off
3 days left at this price!
30-Day Money-Back Guarantee
  • 10.5 hours on-demand video
  • 71 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion

Training 5 or more people?

Get your team access to Udemy's top 2,000 courses anytime, anywhere.

Try Udemy for Business
What Will I Learn?
  • Build sophisticated user interfaces in Java, both in JavaFX and in Swing
  • Use menus, trees, buttons, tables and all the important standard UI-building techniques - both in JavaFX and in Swing
  • Use Scenebuilder and FXML to effortlessly create UIs using dependency injection
  • Blur the lines between web and app development by using JavaScript and CSS
  • Build business apps with charts and tables that rival spreadsheets like MS-Excel
  • Leverage the power of Properties and Bindings to get the little details right
  • Build 3D animations in JavaFX
  • Use JavaFX Media support - build an entire, fully functional media player, and also know the limits of Java media capabilities
  • Understand the MVC paradigm and the observer and command patterns that underpin virtually all modern UI frameworks
View Curriculum
  • Programming expertise at the level of a Programming 101 Class, preferably in Java.
  • Prerequisites: Basic understanding of Java
  • Taught by a Stanford-educated, ex-Googler, husband-wife team
  • Hundreds of lines of source code with hundreds of lines of code - just download and open in your IDE

A definitive guide to JavaFX, and a comprehensive guide to Swing are packed into this intensely practical, quirky guide to building awesome UIs in Java

Let’s parse that.

  • This course is a definitive guide to JavaFX: every important part of the framework is covered in great detail, with sophisticated examples and context
  • The course is a comprehensive guide to Swing: you will be able to build sophisticated, clean Swing apps, and employ every important technique.
  • The course is intensely practical, packed with dozens of examples and hundreds of lines of included source code.
  • The course is also quirky. The examples are irreverent. Lots of little touches: repetition, zooming out so we remember the big picture, active learning with plenty of quizzes. There’s also a peppy soundtrack, and art - all shown by studies to improve cognition and recall.

What's Covered:

  • JavaFX: JavaFX as the evolutionary successor of Swing; Javascript and CSS support; FXML and SceneBuilder; how FXML and Dependency Injection work; zippy synching with Properties and Bindings; 3D Animations; 2D Animations (Transitions and Timelines); Charting - for the first time in Java; Media support, and building a real Media Player; Image handling and animated GIF construction; multi-threading in JavaFX; plus all the standard stuff: menus, trees, browser controls;
  • Swing: Framework basics; JFrames, JPanels and JComponents; Menus and menu handling; Trees and their nuances; File choosers, buttons, browser controls
  • Design: The MVC Paradigm, Observer and Command Design Patterns; Dependency Injection via FXML

Programming Drills (code-alongs, with source code included)

  • A News Curation app to summarise newspaper articles into a concise email snippet
  • Animated GIF generation, using Java Image libraries as well multi-threading support
  • A fully fledged Media Player to play MP3 and MP4 files; complex wiring up of UI elements to make sure the little details (volume control, position sliders) work right
  • 2D Animations to rival those available in Powerpoint and other presentation software
  • 3D Animations including moving cameras, rotation and transition of 3D shapes
  • Bubble Charts and Tables to represent revenue, market valuation and growth of a set of companies - a business app as good as Excel
  • Javascript and CSS examples that show how these incredibly powerful tools can be used inside a Java UI app
  • SceneBuilder and FXML support, so that design and implementation can be divvied up between designers and software engineers

Using discussion forums

Please use the discussion forums on this course to engage with other students and to help each other out. Unfortunately, much as we would like to, it is not possible for us at Loonycorn to respond to individual questions from students:-(

We're super small and self-funded with only 2 people developing technical video content. Our mission is to make high-quality courses available at super low prices.

The only way to keep our prices this low is to *NOT offer additional technical support over email or in-person*. The truth is, direct support is hugely expensive and just does not scale.

We understand that this is not ideal and that a lot of students might benefit from this additional support. Hiring resources for additional support would make our offering much more expensive, thus defeating our original purpose.

It is a hard trade-off.

Thank you for your patience and understanding!

Who is the target audience?
  • Yep! UI engineers looking for a definitive resource on JavaFX, the future of Java UI programming
  • Yep! UI engineers looking for a comprehensive first-principles guide to Swing, the most popular UI programming framework right now
  • Yep! Back-end engineers seeking a one-stop-shop course for building awesome front-ends
  • Nope! This course is not right for you if you are looking for a Programming 101 course. You should have a good grasp of programming, ideally in Java, to benefit from this course
  • Nope! This course is probably not right for you if you are a product manager or tech investor - this course is pretty much exclusively focused on the "how", not the "what"
Compare to Other JavaFX Courses
Curriculum For This Course
47 Lectures
Why learn JavaFX and Swing?
1 Lecture 05:02

We - the course instructors - start with introductions. We are a husband-wife team, studied at Stanford, and spent several years working in top tech companies, including Google, Flipkart and Microsoft.

Next, we talk about the target audience for this course: experienced UI programmers who know Swing but now would like to master JavaFX; server-side programmers who know neither Swing nor JavaFX and would like to learn UI programming from 0 to 1, and folks who have done just a little bit of Swing but are not completely confident about their grasp on Java UI programming.

By the end of this class, students will be able to build sophisticated UIs in JavaFX and Swing; you will know how to build clean, maintainable and smooth user interfaces, and will be able to carry this knowledge over to any language or platform.

That's it for preliminaries - with this we plunge right in!

With all great user interfaces, there is a lot more than meets the eye. We start with an exploration of this idea.

Preview 05:02
3 Lectures 43:51

This lecture is an intro to Swing - a Java framework used for building graphical user interfaces (GUI). It covers the building blocks used in Swing, the JFrame and JComponent classes and talks about the pros and cons of using Swing.

The Basic Idea of Swing

We plunge into Swing which is a prototypical UI programming framework. We start with the building blocks of Swing (JFrame and JComponent). Next - the idea of layouts which position controls on screen, and the border layout as an example. Then, JComponents(JTextArea, JTreeView, JMenuBar, JScrollPane, JPanel and JFileChooser).

The Mechanics of Swing I

This lesson explores the different classes that Swing provides for UI components such as menus (JMenuBar, JMenu, JMenuItem). Trees in Swing are pretty powerful but complicated to use, we learn how to deal with their intricacies.

We also learn how to capture and handle mouse events.

The Mechanics of Swing-II
JavaFX Introduced
5 Lectures 41:11

We introduce JavaFX, a new framework which is intended to replace Swing as the standard GUI library for Java. JavaFX features are much more powerful than Swing - stuff such as Properties and Bindings, CSS support pack a real whammy.

Contrasting JavaFX and Swing - I

This course continues with JavaFX features which make it so powerful. Scenebuilder and FXML allow decoupling model and controller code from UI design and definition. Built in 3D effects (illumination, material textures and camera effects), support for animations, charting, audio and video media all make JavaFX a great choice for building user interfaces.

Contrasting JavaFX and Swing-II

The basic building blocks in a JavaFX program - Stage, Scene and Node.

The Mechanics of JavaFX

Properties and Bindings are a Java beans programming construct which allow wiring up of variables to express relationships between them. JavaFX uses this extensively within its framework to expose granular updates for various events.

Properties and Bindings Introduced

We code up a short example to see properties and bindings in action. Two text areas that remain perfectly in sync with each other - changes in one reflect immediately in another.

We are in sync : Properties and Bindings in action
Properties And Bindings
5 Lectures 01:13:26

Open questions on Properties and Bindings. Why are they special? What is the difference between Change Events and Invalidation Events? What are ReadOnly and ReadWrite properties? What are Property objects and Binding objects and how are they different? We answer these and more in this lecture.

Preview 17:24

How do properties announce changes in their values? They implement the ObservableValue interface and Observable interface. This means they accept both ChangeListeners and InvalidationListeners. We'll also see how ReadWrite properties are just writable ReadOnly properties by looking at the entire interface hierarchy.

Preview 14:51

This lecture talks about scenarios where bindings should be used instead of properties. Properties are useful in 1:1 relationships and bindings are useful to model 1:Many relationships. We'll cover specific examples of when Bindings are to be used over properties.

Preview 12:43

We saw when Bindings are useful in the previous class. There are few different ways of implementing bindings and this class takes about the most important ones - static methods in the Bindings class, extending a pre-existing Binding object and the fluent API.

Preview 10:31

JavaFX is powerful because virtually all classes expose their properties for others to bind to. But this might be overkill. We will talk about the benefits of Eager versus Lazy Evaluation of properties. We usually implement Lazy Evaluation of Properties using an InvalidationListener. We will then move on to Eager versus Lazy Instantiation of Properties.

We'll also take a brief look at FXCollections, which are are useful containers that announce when their value changes.

The trick to JavaFX properties: Lazy Instantiation
FXML and SceneBuilder
6 Lectures 01:14:36

We'll introduce FXML and Scenebuilder. Scenebuilder is WYSIWYG tool to setup User Interfaces. FXML is a way to specify Java UI Elements in XML with no code at all. When you consider the MVC paradigm, FXML is a way to set up the view without writing all the boilerplate usually involved.

Complex UIs via FXML and SceneBuilder

FXML is a way to specify UIs in XML. How is this understood by Java? This is classic dependency injection, the controller class in JavaFX is linked to the FXML file - the link relies on two bits of syntax - the @FXML annotation and the fx:id tag

Preview 14:09

The FXMLLoader is pretty amazing. It's the key element in converting an FXML file into a usable Java Object. It does a host of things including instantiating nodes, wiring up listeners etc. The FXMLLoader is the class which takes care of dependency injection in FXML.

Preview 15:40

This lecture talks about important and useful features of FXML files - specifying a stylesheet (CSS File support), localizing your content (localization support through location resolution), property binding inside FXML using the '${..}' notation, nested FXML files (one FXML file inside another FXML file) and using javascript inside FXML files.

The Full Possibilities of FXML - I

We continue exploring intricate details of FXML - property binding inside FXML using the '${..}' notation, javascript support inside FXML files

The Full Possibilities of FXML - II

JavaFX allows us to nest one FXML file inside the other. This allows us to build up our UI in logical blocks.

The Full Possibilities of FXML - III
Shapes and Drawing
2 Lectures 33:10

Shapes and Nodes are at the heart of drawing support in JavaFX. JavaFX provides a bunch of built-in Shape classes all of which can be animated easily. Rotation, translation, etc are easy to use transitions in JavaFX.

Drawing: Shapes and Nodes

Create an animated GIF of all the fonts on your machine. We'll use the snapshot method thats implemented by all nodes and borrow some code from a kind soul who's done the work of converting images to GIFs

Drawing: Fonts and a Segue into Animated GIFs
2 Lectures 31:56

Learn what's at the base of creating some cool animations in JavaFX. The Animation class is at the core JavaFX built-in animation support. Transition animations are built-in and provide a variety of effects like Fade, Fill, moving a Node along a Path etc. Timeline Animations can be used to handcraft custom animations. KeyValues and KeyFrames are the trick to achieving this.

Animation: Timelines and Transitions

Write some code to we animate a text in a bunch of ways (path transition, fade transition, rotate transition, stroke and fill transitions and sequential transition) using JavaFX's built-in animation support.

Transitions Explored
4 Lectures 01:00:32

JavaFX built-in media support is part-lame, part-awesome. Media Support is a great example of the Model-View-Controller (MVC) paradigm in action. JavaFX has built-in media classes to represent each of the Model, View and Controller

JavaFX Media Support: Part-Lame, Part-Awesome

Get started with some common operations on media files - play, pause, stop etc. Setting up a volume slider for the mediaplayer is easy as pie, but a position slider is surprisingly complicated.

JavaFX Media Support: Getting started with common operations

Build your very own Media Player from scratch - and put in all the functionality you would expect - Play, Pause, Stop, Volume and Position controls

Build your own Media Player - I

We continue building our Media Player. Wiring up listeners to set up a position slider is surprisingly complicated. We'll use Platform.runlater() to keep the UI zippy and responsive.

Build your own Media Player - II
Charts and Tables
4 Lectures 42:04

JavaFX has great built-in support for Charts and Tables. Once again these are good examples of the Model-View-Controller (MVC) paradigm in action. Both require some adapter code to be written - the adapter for tables is kind of cool and unlike anything you've seen before.

JavaFX Charts and Tables - I

JavaFX has built-in support for a variety of charts (PieChart, BarChart, LineChart, StackedAreaChart, BubbleChart and more). All these derive from the Chart base class. Wiring up charts requires us to write some adapter code.

JavaFX Charts and Tables - II

Code up a table in JavaFX. Use it represent financial data of some Fortune 500 companies

Charts and Tables : An example - I

Code up a bubblechart in JavaFX and use it to represent the financials of some Fortune 500 companies

Charts and Tables : An example - II
4 Lectures 40:12

Before we get into learning about 3D, we take a detour and remind ourselves of JavaFX support for drawing 2D shapes

3D Rendering : Introduction to 3D Rendering: Segue to Drawing in 2D

Shape3D class is at the heart of 3D rendering in JavaFX. Built-in shapes Sphere, Box and Cylinder derive from Shape3D class. 3D Shapes in JavaFX have 3 important properties : Material, Drawmode and Cullface. 3D representations are created in JavaFX using rotations and 3D animations are created using camera movements.

Introduction to 3D Rendering

We code up our first set of 3D shapes and explore the different properties of 3D shapes in JavaFX (Material, Drawmode and CullFace)

3D Rendering: Getting our feet wet

Handcraft a 3D timeline animation in JavaFX - we learn how to use KeyValues and KeyFrames. Use a Camera to create depth movements in a 3D animation

3D Animations: Timelines and Moving Cameras
4 More Sections
About the Instructor
Loony Corn
4.3 Average rating
5,508 Reviews
42,804 Students
75 Courses
An ex-Google, Stanford and Flipkart team

Loonycorn is us, Janani Ravi and Vitthal Srinivasan. Between us, we have studied at Stanford, been admitted to IIM Ahmedabad and have spent years  working in tech, in the Bay Area, New York, Singapore and Bangalore.

Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft

Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too

We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!

We hope you will try our offerings, and think you'll like them :-)