Skip to content

Introduction

This documentation is intended to help you through learning the basics of JavaFX for building a simple game.

For more information about JavaFX please visit the official JavaFX website.

Intended Users

This guide is for term 2 CST students intending to use JavaFX to create their Object Oriented Programming term project. We will cover the general features that most term projects will have.

Prerequisite Knowledge

To follow this guide you should have:

  • Working knowledge of Java - at least what has been covered in your Object Oriented Programming course so far.

  • Some knowledge of CSS style sheets - helpful to have, but not required.

Software Requirements

  • Java 11 or later
  • IntelliJ IDEA
  • A Windows device of Windows 10 or 11

Overview

The main topics of this documentation is as listed below:

  • Setting up your JavaFX project
  • Handling different types of player interactions
  • Styling your project and adding pizzaz

Formatting (Typographical Conventions)

Code blocks will have a title indicating what class the code is placed in.

Addition.java
1
2
3
4
5
6
7
8
9
    public class Addition {
        private int num1;
        private int num2;

        public Addition(final int num1, final int num2){
            this.num1 = num1;
            this.num2 = num2;
        }
    }
Any additions to previous code will be highlighted.
Addition.java
    public class Addition {
        private int num1;
        private int num2;

        public Addition(final int num1, final int num2){
            this.num1 = num1;
            this.num2 = num2;
        }

        public int Add(){
            return num1 + num2;
        }
    }

Notes and Warning Messages (Admonitions)

Note

Notes provide additional information for a step.

Success

Success indicates what a successful result should look like.

Warning

Warnings contain crucial information about steps that may cause errors if done wrong.