Since the OP is using the extended by org.eclipse.swt.widgets.DateTime class and not the java.util.Date class, I'm not sure that SimpleDateFormat will work here. But according to the API for this class, there is a getYear() method that may work.

07-26-2010, 04:22 AM

Eranga

Of course not. I just point him on his last post, since that's the only thing he explain clearly. :)

07-29-2010, 10:36 AM

ashin

can you give me an example please.. thank you..

07-29-2010, 10:38 AM

ashin

thank you eranga.. but is it possible to get the years from 1980 to present then it will increase every year?

07-29-2010, 10:39 AM

ashin

Quote:

Originally Posted by ashin

thank you eranga.. but is it possible to get the years from 1980 to present then it will increase every year?

What i mean as combo box?

07-30-2010, 05:24 PM

Eranga

Quote:

Originally Posted by ashin

can you give me an example please.. thank you..

Relevant to what? Did you go through the code segment I've posted above in one of my previous post?

07-30-2010, 05:34 PM

Eranga

Quote:

Originally Posted by ashin

thank you eranga.. but is it possible to get the years from 1980 to present then it will increase every year?

Do you want to find the difference between two dates, or just the difference between your years?

Seems to me you have a selection field for the year and you know the starting year. So in that case where you stuck to find the difference? Even you refer them as years, for the VM those are just two integers (an year cannot be a double). Just deduct the largest from the smallest.