forked from AdvancedProgramming1404/WS-06-intro-to-javafx
3dd2d84cdaba7e7a175f354d325358cd35941904
JavaFX Workshop — Pricing Plans UI
Introduction
This workshop introduces students to JavaFX by building a simple pricing plans user interface.
Students will learn how to set up a JavaFX project with Maven, create FXML layouts, apply CSS styling, and handle basic UI events.
Workshop Structure
The workshop consists of building a pricing plans page with three tiers (Basic, Pro, Enterprise) and a theme toggle button.
Topics Covered:
- Setting up a JavaFX project with Maven
- Creating an FXML layout with containers (
VBox,HBox) and controls (Label,Button) - Writing a Controller class with
@FXMLannotations - Handling button click events
- Switching between Dark and Light themes using CSS
- Displaying information alerts
Tasks
-
Implement the
Mainclass:- Load the FXML file using
FXMLLoader - Create a
Sceneand display it on theStage
- Load the FXML file using
-
Implement the
Controllerclass:- Wire up the "Shop" buttons to show payment alerts
- Implement the theme toggle between Dark and Light modes
Learning Goals
By working through this workshop, students should be able to:
- Understand the structure of a JavaFX Maven project
- Read and write basic FXML layouts
- Connect FXML views to Java controllers
- Handle UI events with
@FXMLmethods - Apply and switch between CSS stylesheets dynamically
- Create and show JavaFX dialogs
Languages
CSS
55.3%
Java
44.7%