Re: Null pointer exception with Java 1.4.2, ok with 1.5

From: Andrew Thompson (SeeMySites_at_www.invalid)
Date: 11/27/04


Date: Sat, 27 Nov 2004 13:30:00 GMT

On Sat, 27 Nov 2004 12:05:14 GMT, Luke wrote:

> I'm working on an image applet, and I've developed an object from
> JPanel to show images... this is the simple code:

You're problem is pretty obvious from the code and stacktrace
you posted, but it is an important skill to be able to debug
code yourself.

I'll give you a hint...
<hint>
Ingore everything in the stacktrace except the first line
identifying the error, and the line that refers to your code.
</hint>

Then have a look over this description of how to proceed.
<http://www.physci.org/codes/javafaq.jsp#exact>

Come back to us with your 'best explanation' of what is happening.

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane


Relevant Pages

  • Re: Help with WinEdt
    ... Shortcut: ... Images and Hint: LaTeX ... Images and Hint: PDF LaTeX ...
    (comp.text.tex)
  • Re: Please help the GridLayout problem
    ... I am tring to add several small JPanel to a big JPanel (using ... but I can't get any images displayed. ... The biggest is that the layout manager is setting the size of you JPanel to 0x0. ... While the cognoscenti will wail about not using layout managers, the sad truth is that when you use JPanels with most layout managers you need to specify a preferred size for them or they won't display as you have found out. ...
    (comp.lang.java.gui)
  • Re: Please help the GridLayout problem
    ... of facility group that can hold different level layout. ... of the main form, and display the group two (contains 6 images) at (0, ... For the image group one, I want to display these 4 images in 2 rows ... size of JPanel and size of JPanel before painting. ...
    (comp.lang.java.gui)
  • Re: ImageList
    ... Everything works fine until I add images to the ImageList. ... significantly the StackTrace that should point you at the failing routine. ... Do any of your code routines get a mention in the StackTrace? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Please help the GridLayout problem
    ... I am tring to add several small JPanel to a big JPanel (using ... and display image on these small JPanel (By overiding the ... but I can't get any images displayed. ... public class smallPanel extends JPanel{ ...
    (comp.lang.java.gui)