A memorandum when trying to create a GUI using JavaFX

Purpose of writing the article

It's good that I was a programming beginner and decided to make a GUI in Java It took 5 or 6 hours from building the environment to displaying a clean window. This is because I want to keep it as a memo so that I will not be in trouble when setting it on another OS or PC in the future.

environment

macOS Mojave(10.14.6) JavaSE-11 Eclipse 2020

Environment construction start

1. Install Eclipse

Basically, I installed and set it referring to the following site. https://codeaid.jp/eclipse-java-mac/ I wasn't sure about the workspace directory, so I created it with the default settings.

2. Install and configure e (fx) clipse and Scene Builder

Regarding this, I referred to the following site. https://www.sejuku.net/blog/60411 (No garbled characters occurred when starting Scene Builder.)

SceneBuilder executable for mac Set /Applications/SceneBuilder.app. Select and click "Window"-> "Settings" in the article. Is Go to "Eclipse"-> "preferences".

3. Project creation

Refer to "How to create a new JavaFX project" on the site below. https://style.potepan.com/articles/15319.html It was supposed to end here. .. ..

4. "The imported javafx cannot be found."

When I press Execute, the above error message appears and I cannot execute. When I looked it up, did recent JDKs include JavaFX? so. I will write what I tried below.

・ Access rule settings

Reference page: https://teratail.com/questions/170364 I tried to carry out (2) of the best answer of this question The error did not disappear in this environment.

・ Download and settings of OpenJFX

Reference page: https://nompor.com/2019/01/26/post-4978/ "Download OpenJFX"-"Jar file settings" for the above site I downloaded Product:JavaFX Mac OS X SDK Public version:11.0.2 LTS version:11.0.9 I didn't have the bin folder because it was a mac, but I ignored it and proceeded. (The decompression location is the same level as the workspace directory) The "import error" has now disappeared.

5. "Missing JavaFX runtime components ..."

Next time, this error appears and it cannot be executed. As a result of investigation, I was able to solve it by referring to the following site. https://ameblo.jp/hero-design/entry-12415834565.html The Arguments tab can be configured by right-clicking the project → Run → Run. (Don't forget to change the --module-path part to suit your environment)

Now the error is finally gone When I run it, the Java icon only appears in Doc, and no window appears. .. ..

6. The window is not displayed

Reference page: https://nompor.com/2019/01/26/post-4978/ Mike Davis's answer to this question. When I unchecked it and pressed Execute again, the window was displayed safely.

At the end

I made a start to start making GUI safely. I hope it will be useful for those who are having trouble with the same problem.

The site that I used as a reference https://codeaid.jp/eclipse-java-mac/ https://www.sejuku.net/blog/60411 https://style.potepan.com/articles/15319.html https://teratail.com/questions/170364 https://nompor.com/2019/01/26/post-4978/ https://ameblo.jp/hero-design/entry-12415834565.html https://nompor.com/2019/01/26/post-4978/

Recommended Posts

A memorandum when trying to create a GUI using JavaFX
Easy way to create a mapping class when using the API
A note of someone who stumbled when trying to create a Rails project
[Rails] How to create a graph using lazy_high_charts
A memo when fumbling and developing using JavaFX
GUI sample using JavaFX
A memorandum when trying Spring Data JPA with STS
Create a fortune using Ruby
How to create a method
Sample to create GUI application with JavaFX + IntelliJ + Scene Builder
[Android] Create a calendar using GridView
How to create a jar file or war file using the jar command
Create a Jetty project using Eclipse
A funny story stuck in a mess when trying to import fx-clj
A story of frustration trying to create a penetration environment on Ubuntu 20.04
Preparing to create a Rails application
Create a tomcat project using Eclipse
[Rails 6] How to create a dynamic form input screen using cocoon
Things to consider when running a specified job using Spring Batch
Create a Java project using Eclipse
[Java] How to create a folder
Create a filtering function using acts-as-taggable-on
Try to create a server-client app
Inexperienced create a weather app using OpenWeatherMap and deploy it to Netlify
How to create a query using variables in GraphQL [Using Ruby on Rails]
A story I was addicted to when testing the API using MockMVC
Try to create a browser automatic operation environment using Selenide in 5 minutes
Volume of trying to create a Java Web application on Windows Server 2016
Steps to create a simple camel app using Apache Camel Spring Boot starters
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
How to execute a contract using web3j
Create a web environment quickly using Docker
A memorandum on how to use Eclipse
Create a GUI JSON Viewer with Ruby/GTK3
What to do when a javax.el.PropertyNotWritableException occurs
Error when trying to use heroku command
How to create a Maven repository for 2020
Create a RESTful API service using Grape
[Swift5] How to create a splash screen
[rails] How to create a partial template
Create a prefectural select bar using active_hash
Create a login function using Swift's Optional
[Beginner] What I learned when trying to introduce bootstrap to the rails6 app without using a CDN [Asset pipeline]
Corresponds to a property whose type is an array when empty using JsonDeserializer
A memo to simply create a form using only HTML and CSS in Rails 6
JavaFx memorandum
How to create an Excel form using a template file with Spring MVC
[When using MiniMagick] A memorandum because I stumbled in the CircleCI test environment.
A note when I'm addicted to using Docker Hub Vault in server mode
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
How to create a database for H2 Database anywhere
[Android] Create a sliding menu without using NavigationView
Create a Privoxy + Tor environment instantly using Docker
A memorandum to clean up the code Ruby
[Rails] How to write when making a subquery
Let's create a REST API using WildFly Swarm.
Building a CICD pipeline using Docker (personal memorandum)
How to delete a controller etc. using a command
Try to create a bulletin board in Java
Write to a file using ShiftJIS-Read a file (Kotlin / JVM)
[Ethereum] How to execute a contract using web3j-Part 2-