message box in java code example
Example 1: dialog box in java swing
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] argv) throws Exception {
JOptionPane.showMessageDialog(null, "I am happy.");
}
}
Example 2: java display message
alert('Message');
Example 3: java swing dialog box
JOptionPane.showMessageDialog(null, "java is fun");
Example 4: java joptionpane
JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");