JavaFX Notepad Tutorial

Hello World!

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

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…).

Time to code

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

MainView

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

Menu

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

Model

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

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

原文链接:JavaFX Notepad Tutorial

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
Worrying does not empty tomorrow of its troubles, it empties today of its strength.
担忧不会清空明日的烦恼,它只会丧失今日的勇气
评论 抢沙发

请登录后发表评论

    暂无评论内容