Display message dialog in java (personal memo)

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.

Difference between awt and swing

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.

Show dialog using java.awt

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.

Show dialog using swing

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

Display message dialog in java (personal memo)
Java HashMap, entrySet [Personal memo]
Personal memo: Metaprogramming with Java reflection
Display Firestore data in RecyclerView [Java]
[Personal memo] Java data type is annoying
Organized memo in the head (Java --Array)
[Personal] JUnit5 memorandum memo (work in progress)
[Personal memo] Java development environment is ready
[Personal memo] How to interact with a random number generator in Java
java anything memo
Java Silver memo
Partization in Java
Organized memo in the head (Java --Control syntax)
java, maven memo
How to display a web page in Java
Changes in Java 11
Rock-paper-scissors in Java
Organized memo in the head (Java --instance edition)
Display text as ASCII art in Java (jfiglet)
java anything memo 2
Organized memo in the head (Java --Data type)
Display "Hello World" in the browser using Java
Set pop-up display for Java language in vim.
Pi in Java
Java specification memo
FizzBuzz in Java
Java pattern memo
How to generate / verify ID token in Java Memo
Learning memo when learning Java for the first time (personal learning memo)
[memo] Generate RSA key pair for SSH in Java
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
Display PlantUML in MkDocs
NVL-ish guy in Java
"Hello World" in Java
Java development environment memo
Callable Interface in Java
[Personal memo] try-catch summary
Comments in Java source
java basic knowledge memo
Java learning memo (method)
Java Kuche Day memo
Azure functions in java
[Java ~ Method ~] Study memo (5)
java se 8 programmer Ⅰ memo
Java paid private memo
Format XML in Java
Simple htmlspecialchars in Java
Boyer-Moore implementation in Java
Use OpenCV in Java
webApi memorandum in java
Java static [Personal summary]
Type determination in Java
Ping commands in Java
[Java ~ Array ~] Study memo 4
Java learning memo (basic)
java lambda expression memo
Heapsort implementation (in java)