Hey guys,
I wrote a program that required the use of JOptionPane. The program compiled without an issue. However, when I try to run it, I get these error messages:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(Graphic sEnvironment.java:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init> (SwingUtilities.java:1759)
at javax.swing.SwingUtilities.getSharedOwnerFrame(Swi ngUtilities.java:1834)
at javax.swing.JOptionPane.getRootFrame(JOptionPane.j ava:1697)
at javax.swing.JOptionPane.showInputDialog(JOptionPan e.java:576)
at javax.swing.JOptionPane.showInputDialog(JOptionPan e.java:525)
at javax.swing.JOptionPane.showInputDialog(JOptionPan e.java:475)
at Project0.main(Project0.java:8)
I worked on a Macintosh using terminal. Is there something that I need to download in order to make them work?