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)
[Personal memo] Make a simple deep copy in Java
Java HashMap, entrySet [Personal memo]
Personal memo: Metaprogramming with Java reflection
Display Firestore data in RecyclerView [Java]
Java memo
[Personal memo] Java data type is annoying
[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
[Android 9.0 Pie Java] Implement horizontal swipe → dialog display → delete in chat application
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
Rock-paper-scissors in Java
Organized memo in the head (Java --instance edition)
Java SE 7 memo
java anything memo 2
Organized memo in the head (Java --Data type)
Display "Hello World" in the browser using Java
Display "Hello World" in the browser using Java
Set pop-up display for Java language in vim.
Pi in Java
FizzBuzz in Java
Java pattern memo
[Personal application work memo] How to display a bar graph and a line graph in one graph
[For beginners] Minimum sample to display RecyclerView in Java
Learning memo when learning Java for the first time (personal learning memo)
[memo] Generate RSA key pair for SSH in Java
Read JSON in Java
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
Combine arrays 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 Kuche Day memo
Azure functions in java
java se 8 programmer Ⅰ memo
Java paid private memo
Format XML in Java
Simple htmlspecialchars in Java
Boyer-Moore implementation in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Java static [Personal summary]
Type determination in Java
Ping commands in Java
Java learning memo (basic)
java lambda expression memo