DEV Community

Martin Klestil
Martin Klestil

Posted on

1

JavaFX Notepad Tutorial

Hello World!

I would like to share my learning journey with JavaFX, this is my notepad project.

Image description

Before starting

Java Version: openjdk 22
IDE: IntelliJ Community Edition
Build Tool: Maven

My Plan

If you look at Notepad you can break it down into a few parts. Menu, TextArea, Icon, Title, Control (Close...).

Image description

Time to code

I create with IntelliJ a new JavaFX Project and start with a mvc architecture.

Image description

MainView

The MainView gives me my root element for the Scene, this is where the text area and the menu are added.

Image description

Menu

Next we create the menu. I have created helper functions for the individual menu areas.

Image description

Model

Than we must implement some logic, to make the Menu clickable, editable the text ...

Image description

You can play around here and add all the features you want.

Controller

My controller only connects the view to the models.

Conclusion

Thank you for reading this far! I'm still new to writing articles and have a lot to learn. I appreciate for your feedback.
Happy coding 😊

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay