forked from AdvancedProgramming1404/WS-06-intro-to-javafx
e520a51adaaab1219453cbbf49ebe059d61beb7d
🎨 JavaFX Workshop — Pricing Plans UI
Introduction
Ready to dip your toes into the world of JavaFX? In this workshop, you'll build a pricing plans page — the kind you see on every modern SaaS website (a simple version of them!).
📚 What You'll Learn
| Concept | How you'll use it |
|---|---|
| JavaFX + Maven | Setting up the project structure |
| FXML | Designing layouts without hardcoding |
| Controllers | Connecting UI to Java logic |
| Event Handling | Making buttons actually do something |
| CSS Styling | Making it look good (dark mode included!) |
| Dialogs | Showing payment alerts |
🛠️ Your TODO List
0️⃣ Install VS Code extension for JavaFx Extension
- There is an extension for better JavaFx CSS support in vscode-extension folder
- You can install that with this command on your IntelliJ terminal:
code --install-extension "vscode-extension\css-helper-for-javafx-1.0.1.vsix"
- (Optional) Also after that open your VS Code press
CTRL+SHIFT+P, enterdefault setting, open settings.json and finally add this line:
"css.lint.vendorPrefix": "ignore",
1️⃣ Main.java
- Load the FXML file using
FXMLLoader - Create a
Scene, set its title, attach CSS file to it, and show it on theStage
2️⃣ Controller.java
- Wire up the "Shop" buttons → show payment alerts
- Implement theme toggle (Dark ↔ Light)
🎓 Learning Goals
By working through this workshop, you'll be able to:
- Understand the structure of a JavaFX Maven project
- Read and write basic FXML layouts
- Connect your visual design (FXML) to Java code (Controllers)
- Handle UI events with
@FXMLmethods - Switch CSS themes dynamically
- Create and show JavaFX dialogs
📝 Notes
Always run your Javafx app from the Launcher.java, Launching from the Main.class (where you have extended from Jfx Application) sometimes doesn't work due to building issues, and you get error of not finding Javafx.
Don't forget to set your jdk in the Project Structure > SDK !
Languages
CSS
53.3%
Java
46.7%