I am learning GUI in Java, and for that I have created a demo program:
import java.awt.*;
public class FrameDemo extends Frame {
public FrameDemo(){
Check what your environment variable DISPLAY's value is. Try running a simple X application from the command line. If it works, check DISPLAY's value for the right value.
You can experiment with different values of and environment variable on a per invocation basis by doing the following on the command line:
DISPLAY=:0.0
How are you calling your program?