I've compiled the code and tried running it but i still receive a error.
import javax.swing.*; public class Array { public static void main(String [] arg) { String namn; String hälsning; namn = JOptionPane.showInputDialog ("Vad heter du"); hälsning = "Välkommen" + namn; JOptionPane.showMessageDialog(null, hälsning); } } //error message is as the following 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(GraphicsEnvironment.java:204) at java.awt.Window.<init>(Window.java:536) at java.awt.Frame.<init>(Frame.java:420) at java.awt.Frame.<init>(Frame.java:385) at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1763) at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1838) at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696) at javax.swing.JOptionPane.showInputDialog(JOptionPane.java:576) at javax.swing.JOptionPane.showInputDialog(JOptionPane.java:524) at javax.swing.JOptionPane.showInputDialog(JOptionPane.java:474) at javax.swing.JOptionPane.showInputDialog(JOptionPane.java:440) at himynameis.main(himynameis.java:8) //using Codeanywhere.