Java Jpanel -Nachrichten Fehlermeldungen

import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class JOptionPaneERROR_MESSAGE {

  public static void main(String[] args) {
    final JPanel panel = new JPanel();//create new Jpannel

    JOptionPane.showMessageDialog(panel, 
           "Could not open file", "Error", JOptionPane.ERROR_MESSAGE);
    //show gui message in object panel, message with ERROR icon and Error text

  }
Anxious Angelfish