• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Program throws a NullPointerException when we setNominalViewingTrasform

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following code is supposed to create a Cylinder object and add it to the scenegraph. The radius and height for the Cylinder object are provided using a dialog box, so when the input is entered a Cylinder with the set parameters should appear on the canvas.



But when i run this code it throws the following exception.


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Animapp.actionPerformed(Animapp.java:106)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6216)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5981)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


any idea what i'm doing wrong?

cross posted at:
http://forums.sun.com/thread.jspa?threadID=5378445&CWP_SESSION=AQIC5wM2LY4SfcwHFyRvaLZyO1WbrgaAsBcDiUsyjA6SCq4%3D%40AAJTSQACMTcAAlMxAAIwMw%3D%3D%23

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cross posted at http://ubuntuforums.org/showthread.php?t=1115869

N Prasad,
Please read this
http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
 
N Prasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exception has been resolved! Should i delete this thread? Just checking to be sure, so as to not waste anyone's time.

Thanks
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

N Prasad wrote:The exception has been resolved! Should i delete this thread?

No.

Welcome to JavaRanch

We don't have a policy of deleting threads; this thread might be useful to somebody else who has a similar problem in the future. It would be a good idea, however, briefly to tell us what the problem was and how it was corrected (or provide a link to other discussion with the solution). please.
 
N Prasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a link to the page where the problem was solved :

http://ubuntuforums.org/showthread.php?t=1115869

And sorry about the cross-postings. I thought the problem may have something to do with Java3D. So i posted the same query on a forum devoted to Java3D as well. The problem is that you don't have a lot of very active members on the Java3D forums, to respond to the queries. And there aren't enough useful tutorials (or i couldn't get my hands on them!)

A quick question... it seems I've posted this thread in the wrong section of this forum. Is there anyway I could move it to the "Other Java APIs" section? The code doesn't yet do quite what I expected it to. Should I accordingly edit the query and post it in the other section. Or would that be considered spamming?
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the solution; lots of people get NullPointerExceptions for the same reason.

Please don't edit the original post; if you change the original and the answers are unchanged, the thread will be very confusing to read.
And you can't move the threads; we moderators can, but I prefer to leave that to Maneesh and Rob who "lead" this forum, if possible.
I think maybe a good way to proceed would be to past a new query in the "other APIs" forum saying what the problem is, and quoting a link to this thread to say where the code is.
 
N Prasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


It seems there was some problem with my Java3D installation. I uninstalled and reinstalled Java3D and now the same code is working fine. Thanks for your time and sorry for this post.


Moderator kindly remove this thread.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

N Prasad wrote:Moderator kindly remove this thread.


Like Campbell said, we don't remove threads simply because they have been answered.
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to be sorry; we are happy to see people get their problems sorted out. As I said before, this thread might be useful if somebody else has the same problem in the future, so we don't usually delete threads.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic