Image in JLabel



i am working on netbeans my problem is as follows ......in my jframe
i have introduced a JLabel and from the properties of JLabel i have
introduced a gif image , the program gets compiled well but it
generates following Exceptoins when i run the program , pls if anyone
can help me to get it done

thanks

init:
deps-jar:
compile-single:
run-single:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
at motion.motion.initComponents(motion.java:34)
at motion.motion.<init>(motion.java:17)
at motion.motion$1.run(motion.java:80)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
173)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:
121)
BUILD SUCCESSFUL (total time: 1 second)
.



Relevant Pages

  • Re: JFrame does not automatically resizes to JLabels length
    ... > I am using three JLabel's on a row using the BorderLayout. ... > JLabel must be aware of the JFrame, ... getPreferredSize() will be called which so long ...
    (comp.lang.java.gui)
  • JFrame does not automatically resizes to JLabels length
    ... I am using three JLabel's on a row using the BorderLayout. ... It seems that running pack on JFrame after every JLabel.setTextdoes solve ... JLabel must be aware of the JFrame, ...
    (comp.lang.java.gui)
  • Havnig a problem resizing a JLabel with MouseMotionListener.
    ... I have a JTable embedded in a JLabel. ... My problem is that I wish to allow resizing of the JLabel ... The JFrame already has resizing functionality. ... my goal is to allow the user to resize the JTable. ...
    (comp.lang.java.gui)
  • Re: Timer & JLabel
    ... This was generated using NetBeans and the jLabel has been added ... Don't assign Swing objects to statics. ...
    (comp.lang.java.programmer)
  • Using GridBagLayout with JFrame
    ... gridbaglayout if possible) so that when the JFrame pops up, ... 'white space' between the JLabel and JButton. ... the JLabel and JButton are on top of one another. ...
    (comp.lang.java.programmer)