471,354 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Handle headless exception in java

Hi All,

My program is running on a headless mode and I need to set the look
and feel of my program but it gives me Headless Exception when I try
to set the look and feel.
The exception is as follows

at sun.java2d.HeadlessGraphicsEnvironment.getDefaultS creenDevice(null:-1)
at com.sun.java.swing.plaf.windows.XPStyle.getImage(n ull:-1)
at com.sun.java.swing.plaf.windows.XPStyle.access$200 (null:-1)
at com.sun.java.swing.plaf.windows.XPStyle$Skin.<init >(null:-1)
at com.sun.java.swing.plaf.windows.XPStyle$Skin.<init >(null:-1)
at com.sun.java.swing.plaf.windows.XPStyle.getSkin(nu ll:-1)
at com.sun.java.swing.plaf.windows.WindowsTreeUI$Expa ndedIcon.<init>(null:-1)
at com.sun.java.swing.plaf.windows.WindowsTreeUI$Expa ndedIcon.createExpandedIcon(null:-1)
at com.sun.java.swing.plaf.windows.WindowsLookAndFeel .initComponentDefaults(null:-1)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefault s(null:-1)
at javax.swing.UIManager.setLookAndFeel(null:-1)
at javax.swing.UIManager.setLookAndFeel(null:-1)

Can any one tell me please how I can set the look and feel without
gettig this exception?

Thanks,
Subhadeep.
Jul 17 '05 #1
1 4859
> My program is running on a headless mode and I need to set the look
and feel of my program but it gives me Headless Exception when I try
to set the look and feel.


From the Sun API:

"public class HeadlessException extends UnsupportedOperationException
Thrown when code that is dependent on a keyboard, display, or mouse is
called in an environment that does not support a keyboard, display, or
mouse."

You say you want to set the Look & Feel of an application that has no
Look & Feel... Aren't you trying to fix the tires of a boat, buying
Happy Meals without having children, calling interrupt() on a Thread
that is already dead, etc.?

Regards,
Joost
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Vissu | last post: by
6 posts views Thread by Liming | last post: by
8 posts views Thread by Lambda | last post: by
reply views Thread by star111792 | last post: by
9 posts views Thread by =?Utf-8?B?UmFq?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.