Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2006

Tip: Looking for answers? Try searching our database.

Eclipse - NullPointerException for the simples possible applet

Thread view: 
si - 22 Mar 2006 13:03 GMT
Hello

I've just started using Eclipse 3.2.1 and I've observed that every few
launches of the simples possible applet (see the code below) I get the
following error (it happens only when exitin applet viewer):

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException:
component argument pData
at sun.awt.windows.Win32SurfaceData.initOps(Native Method)
at sun.awt.windows.Win32SurfaceData.<init>(Win32SurfaceData.java:448)
at sun.awt.windows.Win32SurfaceData.createData(Win32SurfaceData.java:316)
at
sun.awt.Win32GraphicsConfig.createSurfaceData(Win32GraphicsConfig.java:357)
at
sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:332)
at
sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:313)
at sun.awt.windows.WComponentPeer$2.run(WComponentPeer.java:353)

The applet code looks like this:

import javax.swing.JApplet;

public class dummy extends JApplet {

     /** Constructor */
     public dummy() throws HeadlessException {
       super();
       // TODO Auto-generated constructor stub
     }

}

Is this a bug or I'm doing something wrong?
Thanks
si
Patricia Shanahan - 22 Mar 2006 18:03 GMT
...
> The applet code looks like this:
>
[quoted text clipped - 13 lines]
> Thanks
> si

I changed the name, because I didn't want a class called just "dummy"
floating around in my test directory, and added an import for
java.awt.HeadlessException to get it to compile. The result ran:

  import javax.swing.JApplet;
  import java.awt.HeadlessException;

  public class DummyApplet extends JApplet {

        /** Constructor */
        public DummyApplet() throws HeadlessException {
          super();
          // TODO Auto-generated constructor stub
        }

  }

Does this run on your system?

Patricia
si - 22 Mar 2006 18:58 GMT
> I changed the name, because I didn't want a class called just "dummy"
> floating around in my test directory, and added an import for
[quoted text clipped - 16 lines]
>
> Patricia

Sorry, I forgot about the line with HeadlessException import.
I have it in my code but it crashes anyway.

I have two computers, both XP Pro SP2. The applet runs ok on one of them
(that is on the computer it was created) and crushes on the other one.
Maybe this is a metter of some project settings, I don't know.

si
Oliver Wong - 22 Mar 2006 20:01 GMT
> Hello
>
[quoted text clipped - 30 lines]
>
> Is this a bug or I'm doing something wrong?

   It's a bug. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5062191

   - Oliver
si - 23 Mar 2006 08:34 GMT
>    It's a bug. See
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5062191
>
>    - Oliver

Thank you!
si


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.