Results 1 to 6 of 6

Thread: Headless Exception in Java

  1. #1
    Join Date
    Nov 2009
    Posts
    712

    Headless Exception in Java

    Hello, I am learning java programming language and while learning java programming I have come across a exception which I have not heard yet. It is a Headless Exception in java. I am not having details about it. If anyone from you are having information about the Headless Exception in java then please provide information about it to me.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: Headless Exception in Java

    The Headless Exception in java is a public class which extends UnsupportedOperationException. This type of exception will be 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. I am also not having more information about it. But, from this you will able to know the some details about it.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Headless Exception in Java

    Headless Exception is a class in java and it provides you a method as public String getMessage(). It is having description which is copied from class: Throwable. This will return the whole information about the message string of this throwable. This method will override the getMessage in class Throwable. And when this method will get executed you will get the returning value of the string message of the Throwable instance.

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Headless Exception in Java

    Hey, while creating a look and feel for my project, I have got this Headless Exception in Java. It will be provide you exact overview of how the structure of headless exception is exist.
    at sun.java2d.HeadlessGraphicsEnvironment.getDefaultS creenDevice(null:-2)
    at com.sun.java.swing.plaf.windows.XPStyle.getImage(n ull:-2)
    at com.sun.java.swing.plaf.windows.XPStyle.access$300 (null:-2)
    at com.sun.java.swing.plaf.windows.XPStyle$Skin.<init >(null:-2)
    at com.sun.java.swing.plaf.windows.XPStyle$Skin.<init >(null:-2)
    at com.sun.java.swing.plaf.windows.XPStyle.getSkin(nu ll:-2)
    at com.sun.java.swing.plaf.windows.WindowsTreeUI$Expa ndedIcon.<init>(null:-2)
    at com.sun.java.swing.plaf.windows.WindowsTreeUI$Expa ndedIcon.createExpandedIcon(null:-2)
    at com.sun.java.swing.plaf.windows.WindowsLookAndFeel .initComponentDefaults(null:-2)
    at javax.swing.plaf.basic.BasicLookAndFeel.getDefault s(null:-2)
    at javax.swing.UIManager.setLookAndFeel(null:-2)
    at javax.swing.UIManager.setLookAndFeel(null:-2)

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: Headless Exception in Java

    Hey, if you want to get the Headless Exception in Java then you need to use the code below. I have got it while working on this code:
    Code:
    image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
    graphic = image.createGraphics();
    graphic.setColor(Color.white);
    graphic.fillRect(0, 0, size.width, size.height);
    component.setBounds(0, 0, size.width, size.height);
    component.paint(graphic);

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Headless Exception in Java

    Hey, if you make use of the book below then you will able to get the solution for your problem:
    • Java Language Specification
    • Java Native Interface
    • Core Servlets and JavaServer Pages
    • Thinking in Java - Bruce Eckel's renowned book
    • Advanced Programming for the Java 2 Platform
    • A Java GUI Programmer's Primer

Similar Threads

  1. Exception in Java Web Start
    By Jaganmohini in forum Software Development
    Replies: 6
    Last Post: 27-07-2010, 01:15 PM
  2. Malformed exception in java
    By Amy Adams in forum Software Development
    Replies: 5
    Last Post: 24-03-2010, 08:25 AM
  3. How to catch an Exception in Java?
    By SKREECH in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 04:50 AM
  4. Code for Exception in Java
    By taher in forum Software Development
    Replies: 4
    Last Post: 15-01-2010, 09:09 PM
  5. HtmlUnit 2.4 - a headless java browser released
    By Pyrotechnic in forum Technology & Internet
    Replies: 1
    Last Post: 05-01-2009, 12:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,669,046.43842 seconds with 17 queries