Mega Code Archive

 
Categories / Java / Swing JFC
 

Display error message dialog with JOptionPane ERROR_MESSAGE

import javax.swing.JOptionPane; import javax.swing.JPanel; public class JOptionPaneERROR_MESSAGE {   public static void main(String[] args) {     final JPanel panel = new JPanel();     JOptionPane.showMessageDialog(panel, "Could not open file", "Error", JOptionPane.ERROR_MESSAGE);   } }