title: Is there a way to create a JFrame in an online compiler?
body: <p>I have used NetBeans IDE 8.2 for a while to create Java programs, and have had no trouble with it. I was trying to find an online compiler that will allow me to create a JFrame, but I usually get the error saying</p>
  
  <pre><code>No X11 DISPLAY variable was set, but this program performed an operation which requires it.
      at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
  </code></pre>
  
  <p>I have tried several different online compilers, as well as researching the X11 DISPLAY, but I haven't found anything useful.</p>
  
  <pre><code>import java.awt.Canvas;
  import javax.swing.JFrame;
  
  public class Main {
  
      public static JFrame frame;
      public static Canvas canvas;
  
      public static void main(String[] args) {
          createDisplay("Display", 500, 500);
      }
  
      public static void createDisplay(String title, int w, int h) {
          frame = new JFrame(title);
          frame.setSize(w, h);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setResizable(true);
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
  
          canvas = new Canvas();
          canvas.setSize(w, h);
          canvas.setFocusable(false);
  
          frame.add(canvas);
          frame.pack();
      }
  }
  </code></pre>
  
  <p>Is there a way to set the X11 DISPLAY variable to make it work on an online compiler?</p>