What's wrong with my date getter?
I don't have the code with me right now, but I had it try to change the date into DayOfWeek Month DayOfMonth, Year
and put that on a JMenuBar as the text for a JMenu, but it's saying
Saturday March (I can't recall), 1
This was in that file that was giving me trouble. But I'm redoing it now in steps.
It always being Saturday mgiht be that I did make it on a Saturday and maybe it's never updated since that day. However, that was in November, not March. And why is it getting the year wrong?
Is it because I put it in a JMenu?
Re: What's wrong with my date getter?
Quote:
Originally Posted by
javapenguin
I don't have the code with me right now, but I had it try to change the date into DayOfWeek Month DayOfMonth, Year
and put that on a JMenuBar as the text for a JMenu, but it's saying
Saturday March (I can't recall), 1
This was in that file that was giving me trouble. But I'm redoing it now in steps.
It always being Saturday mgiht be that I did make it on a Saturday and maybe it's never updated since that day. However, that was in November, not March. And why is it getting the year wrong?
Is it because I put it in a JMenu?
I'm guessing here, but I remember vaguely some weird date old computers used as a reference date for all dates. If you didn't intialize the date properly, you would get a very old date. That wasn't in Java though, and probably in an older version of Windows (or even DOS).
Have you tried outputting the date to the console or to a file before transformation?
Edit: Oops, I found what this old date thing was. It's on Apple computers. Apparently they have some numeric variable that holds the seconds since the first of January 1970.
Re: What's wrong with my date getter?
I did print it out. However, I only printed out the text I set it to. #-o
Never tried to see if putting it in the JMenu was corrupting it.
However, what could be the problem?
:-?
Re: What's wrong with my date getter?
Quote:
Originally Posted by
javapenguin
I did print it out. However, I only printed out the text I set it to. #-o
Never tried to see if putting it in the JMenu was corrupting it.
Well, first thing is to find out where the problem occurs. Try to add a simple System.out.println(...) statement at different spots to do basic debugging.
Quote:
However, what could be the problem? :-?
You have to know that I am not very good at Java. I'm making some suggestions but at some point I won't be able to help any further.
I doubt it has anything to do with the JMenuBar. That should take standard text.