I was enthusiastic and didn't post in just the first day ... Immediately, I will post it as a memo for myself. I usually do not code in java, so I will describe the results of various investigations without knowing how to display the dialog.
As mentioned above, I don't usually touch java at all, and I rarely build GUI programs, so I started from here. I knew the names of awt and swing and somehow how to use them, but I didn't know the difference. (In addition, JavaFX is also described.)
--AWT is available for all Java versions and has the advantage of working with any Java runtime. --Inheriting AWT, eliminating the drawback of AWT, "GUI appearance depends on platform", and eliminating lack of extensibility --JavaFx: You can write a design using XML and CSS together, and separate design creation and processing class description.
I referred to the following article.
As far as I checked, it felt a little annoying. I just want to use something like the MsgBox function in VBA.
--Import java.awt --Dialog class instantiation, dialog generation --Specify the size with dialog.setSize --Dialog is displayed with dialog.setVisible --Processing to close the frame if necessary -Creating a java.awt.Dialog dialog ← I referred to this article.
Just import javax.swing.JOptionPane and call JOptionPane.showMessageDialog. I didn't want to spend time, and I adopted this for the app I'm making now. Code omitted.
I referred to the following article.
-Java: How to display a message in a dialog -Display warning dialog -Display message in dialog box
Recommended Posts