title: java.awt.HeadlessException when calling JOptionPane.showMessageDialog in backing bean action method
body: <p>I'm trying the following:</p>
  
  <p><code>labelconfig.xhtml</code>:</p>
  
  <pre><code>&lt;h:form id="ok"&gt;
      &lt;h:commandButton value="click"&gt;
          &lt;f:ajax event="click" listener="#{canvasController.oeps}" /&gt; 
      &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>And I'm trying to get it here:</p>
  
  <p><code>CanvasController.java</code></p>
  
  <pre><code>@ManagedBean(name = "canvasController")
  @SessionScoped
  public class CanvasController
  
      public void oeps(AjaxBehaviorEvent event) {
          JOptionPane.showMessageDialog(null, "SUCCES3");
      }
  
  }
  </code></pre>
  
  <p>But when I click the button, I get:</p>
  
  <blockquote>
    <p>serverError: class java.awt.HeadlessException</p>
  </blockquote>
  
  <p>How is this caused and how can I solve it?</p>