Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when running swing program getting error

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
my code is this



Compiling: javac HelloWorldFrame.java
running:java HelloWorldFrame
when i running i getting below error i am new to this help me

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:159)
at java.awt.Window.<init>(Window.java:407)
at java.awt.Frame.<init>(Frame.java:402)
at java.awt.Frame.<init>(Frame.java:367)
at javax.swing.JFrame.<init>(JFrame.java:163)
at HelloWorldFrame.<init>(HelloWorldFrame.java:11)
at HelloWorldFrame.main(HelloWorldFrame.java:9)

[edit]Add code tags CR[/edit]
[ July 07, 2008: Message edited by: Campbell Ritchie ]
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You ought to know how to add code tags by now.

Have you looked for HeadlessException in the Java API documentation? It tells you that you are short of a dependency (keyboard, screen or mouse) which is required to display your application. The message about X11 suggests you haven't got the screen configuration set up. Maybe your version of the OS runs only on a command-line.
It runs nicely on my PC without any changes.

You will probably get more appropriate help if I transfer you to a different forum . . .
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is a Java-related problem, but to do with X11 settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic