*
The moose likes Swing / AWT / SWT and the fly likes Null dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Null dates" Watch "Null dates" New topic
Author

Null dates

Giuseppa Cefalu
Ranch Hand

Joined: Jul 15, 2011
Posts: 121
In the code below a date must be a date object and therefore date cannot be initiliazed to zero. I have to use a date object becuase the setValue method only takes a date. If I initialize the date to null, i get an exception in thread main null pointer exception. Is there any workaround so that one can initialize the date to 0 or null and still gat a date object that can be accepted by the setValueAt() method? Thank you

Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3595
    
  14

Sounds like a recipe for disaster. Why are you setting the date if you have no date to set?
Giuseppa Cefalu
Ranch Hand

Joined: Jul 15, 2011
Posts: 121
Thank you very much!!! Your comment was very helpful. All I need is

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Null dates
 
Similar Threads
NoSuchMethodException for java.lang.Class.setValue
new bie question-- top-level classess
Try Catch finally
How to fetch Date from DateTime in mySql
ternary operator