When you want a tool in a project, Excel macros are still on the business trip in the SI area, It's heavy and difficult to maintain, and I wonder if there is anything else. I will try it as a Java client application and summarize the procedure.
One of the things that will be taken care of in the introduction to Java is AWT and Swing, and JavaFX is the GUI library that appeared as the successor to them. By adopting design tools such as SceneBuilder, XML and CSS, the aim is to separate design and business logic.
The bottleneck of Java client applications is that they require a Java execution environment for the device to be started. Then, it works or does not work due to the version difference for each terminal. This is not popular. Therefore, JRE is also installed in the distribution application so that the application can refer to it. Now you can run the app regardless of the environment on the device side. This will be popular.
This time, Windows10 and eclipse are used as the development environment.
Help ⇒ From the Eclipse marketplace, enter JavaFX etc. to search. Let's install a plugin called e (fx) clipse. (If it does not appear in the search, the version of Eclipse may not be supported. Please upgrade or get the latest version of Eclipse to solve the problem. )
Scene Builder is a design tool that allows you to build GUI parts such as text boxes and buttons by operating the mouse. Looking at Introduction to Java in Tohoho, I remembered the time when I was building steadily, and it became convenient without my knowledge. I just think.
The tool can be downloaded from this site. After installation, let's link the Scene Builder executable file to eclipse.
Select JavaFX Project from File → New → Other Java project settings are your choice. (I think the initial settings are fine for the time being) When you proceed to the next step, you will finally be asked for UI settings. In this article, set the following.
Since Java11, OpenJDK and OpenJFK have been separated. The JavaFX module does not exist in the above procedure, so you need to devise one more thing.
This time, it was solved by merging the OpenJFX module into OpenJDK. I am creating a merged version of the JDK by borrowing the procedure / tool from the following.
Being separated from the JDK makes JavaFX more difficult to work with. It is quite complicated to put OpenJFX in the PATH and specify --add-modules javafx.controls as the VM argument when executing the application. This complexity is due to JavaFX being separated from the JDK. Once you merge JavaFX into the JDK, you can use JavaFX like traditional Java without worrying about module specifications.
Add the created JDK to eclipse and you're ready to go!
Reference: There seems to be another way to add the OpenJFX library to the dependency from Maven Central.
You can move to Scene Builder by right-clicking Form.fxml ⇒ "Open with Scene Builder".
The Document at the bottom left corresponds to the frame of the illustration. At first, only a Container called AncorPane is declared. First of all, let's secure the area of this Pane.
Click Ancor Pane at the bottom left ⇒ Enter "300" in the leftmost cell of Layout "Padding" on the right. If you click the ">" to the right of it, it will be copied to other cells as well. I think a white background has appeared in the center. This is the area of AncorPane.
I will place buttons and so on on this. Drag and drop Controls ⇒ TextField on the left side to the center to add TextField to Document. Enter the ID in Code ⇒ fx: id on the right side and set the ID of this TextField.
Buttons are also arranged in the same way. Set the ID in fx: id and On Action. Now you are ready to "type in the text and press the button".
Scene Builder menu ⇒ View ⇒ Show Sample Controller Skeleton Based on the view settings so far, it will present a template for the controller. Check Full and press Copy. Comments are your choice.
Go back to eclipse and paste the copy into the controller class. After that, you can add logic to onButtonAction. How easy it is!
Once you've done this, let's check the operation once. Right-click Main.java ⇒ Run ⇒ Java Application You should see a window with the button and text field created in step 2.
I wanted to make something that could be used because it was a good idea, so I made it a tool that analyzes the topic of the sentence set. I put it on Git. Clone and run Main.java and it will work. It's easy, but please refer to it as a sample project.
This time, we even created a JavaFX application. I hope you can have an image that seems to be reachable for GUI tools. The flow of distributing the created application is described in this article.
Add the following sentence to SceneBuilder.cfg. If the cfg file is overwrite-protected, modify the access authority from the properties etc. and edit it.
-Duser.language=en
Reference: What to do if characters are garbled in Scene Builder