Display a JCalendarCombo and click on it to bring up a calendar/time popup.
Put focus on of the elements of the date/time spinner at the bottom of the screen - say, the month. Then change the month using the spinner control.
Now, when the popup is dismissed, the new date is not reflected in the combobox.
Is this perhaps fixed in a later release? The last release I see in the downloads are is from 2005. Is that the latest?
thanks for any help,
tom wolf
twolf@netforensics.com
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The month "spinner" is for viewing, not setting the month. Actually, you never set the month, you set the day (by clicking on a day) and that sets the day, month and year.
The time spinner is different. Changing the time there will set the time. It is a true "spinner" in that it has a text field with small up/down arrows attached on the right.
The month and year buttons are for navigation, to get you to where you can select a specific day.
I hope this clears up your confusion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Antonio,
I'm not talking about the month and year buttons - When I used the word "spinner", I really meant it :-)
I can't find a way to attach a screenshot as part of this posting, so I will try to be more precise.
When I click on the JCalendar combo box, a popup appears which has three areas:
1) a Button area for chaning the viewed month or year
2) a "month" area with buttons for each day of the month
3) a spinner that allows the user to change MM/DD/YYYY HH:MM:SS
I'm looking at the spinner at the bottom of the popup and it looks something like this:
12/16/2008 10:36:22<up/down>
You can focus on any of the fields, month, day, year, hour, minute, or second and then use the up/down controls of the spinner to change these. When I focus on on the month, day, or year and change them via the spinner controls, nothing changes anywhere - my listener's dateChanged() method doesn't even get called. On the other hand, if I focus on the time elements of the spinner and change any of them via the up/down controls of the spinner, my dateChanged() method IS called and the new time IS reflected in the combobox when the popup is dismissed by clicking somewhere outside the popup's area.
I hope this clarifies things. The date part of the spinner seems to be absolutely without function. If it's supposed to be doing nothing, it shouldn't be part of the spinner.
thanks for any feedback,
tom
twolf@netforensics.com
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I look at the documentation, I see a lot of references to a time spinner, but none to a time/date spinner.
The documentation for JCalendar says "The date is selected using a calendar display. The time is selected using a date spinner." While this may not be the clearest way to state it, it appears that dates are not supported by the time spinner. You should limit your time pattern to a time.
If you wanted to select a date without using the calendar, you could use an editable JCalendarCombo.
You could submit an enhancement request to add this capability. To be honest, though, it's unlikely I'll add this unless you also provide working code. It's been so long since I worked on this, that I had to read the documentation to figure out the problem!
P.S. While it appears that you can't attach anything in Forums, you can attach files in the Trackers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When this is added to a panel, you'll see a combobox that includes date and time. When you click on the drop-down, you will see a popup that includes a single spinner via which to adjust both the date and time. The bug is that the date adjustments have no effect whatsoever. That's really a bug, not an enhancement.
If nothing else, I was hoping that at least an event would get generated - this way I can at least do something when the user does something with the spinner (assuming I have access to the spinner's current content).
I can try to find the "Tracker" you speak of (never used sourceforge much before, so I don't know my way around yet) to upload an image of what I'm talking about, but hopefully my explanation was good enough.
If you don't have the time to fix it, I'd be happy to look into the problem, but I have never looked at the source code, so it would take me probably a much longer time to find/fix the issue than it would take you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Antonio,
I just registered as a user on sourceforge and tried to submit a bug so that I can attach the screenshot of the JComboBox as I see it. But the system says that only members of the project can do this? Maybe I'm missing something obvious?
thnx,
tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There's nothing special about my setup on SourceForge, so keep in mind you have all the resources available to any SourceForge user to help you in entering a bug. As always, Google is your friend.
That said, go to Tracker and then Feature Requests (this is not a bug, in my opinion) and look around for the word "Add". I just noticed that there's a new Tracker interface and the terminology is now "Add an artifact".
As for whether you have to be a member of the project: I am the only member and somehow others have managed to report bugs and ask for enhancements, so I assume it's possible. I am also not in the best position to test whether the staff at SF have done something to block bug postings.
Finally, with regards to your statement—"If you don't have the time to fix it, I'd be happy to look into the problem, but I have never looked at the source code, so it would take me probably a much longer time to find/fix the issue than it would take you."—thanks for the offer to look into this enhancement.
Your assumption about how long it might take for me to do this vs. you is not correct. First, it's been years since I wrote the code. I don't write Java code much these days. Second, I don't consider this a bug, so it's not something I feel any need to fix. Third, I'm not sure it's even a good idea. I have a vague memory that I tried doing something like this at one point and discovered some nasty side-effects and decided to stick with just the time spinner for time selection and the calendar for day/month/year selection.
If this feature is important to you, you will have to code it yourself. If it works really well and you'd like to share it with others (as I've shared my code with you), you can send me your working code for me to try out. If I agree that it improves the component, I'll incorporate your code and provide you with a credit.
Good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Antonio,
I think you're still misunderstanding my explanation. In your posting you say:
"...Second, I don't consider this a bug, so it's not something I feel any need to fix....and decided to stick with just the time spinner for time selection and the calendar for day/month/year selection."
But you are NOT simply using a "time spinner" for time selection! The JCalendarCombo I described before brings up a popup that has a single JSpinner that shows a date and time AND WHICH LETS YOU SPIN EITHER THE DATE OR TIME COMPONENTS.
A user can spin the month - but it has no effect when the popup is dismissed. A user can spin the hour - and it does take effect when the popup is dismissed. Two different outcomes when spinning two different parts of the same spinner. Seems like a straight-forward bug to me. If you didn't want the user to manipulate the date via the spinner, then the spinner should not include the date.
I downloaded the code - perhaps, if that was your intent, I will try and change the code to do just that (have the spinner just show the time).
I will try to file this bug in tracker as you suggest - perhaps you're just not remembering the look of the popup and an annotated screenshot would explain better than any words.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Antonio,
I looked at the source code and the problem lies in the fact that I'm using the JCalendarCombo constructor whose last argument is the "timePattern" format string. I was passing in the same formatting string that I subsequently use for the JCalendarCombo.setDateFormat() - a format string that includes mm/dd/yyyy. Your constructor then sets a "timePattern" class variable that is later passed to SpinnerDateModel that drives your JSpinner.
Anyway, if your intent is to not let the user modify dates on your spinner, perhaps the solution is to ignore that parameter on the constructor. But it's up to you - since I can simply pass in NULL, I have a workaround.
Thanks though for listening to my postings. And thanks for the component!
best regards,
tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry about your frustration, but I did understand your problem, even if I was not making that clear to you.
I know that you were passing in a format that included the year/month/day where you should have been passing only a time format. This is not a bug: garbage in, garbage out. The contract for this function requires that the format be just a time value. Violate the contract and you're on your own.
You could argue that I should generate an error message or somehow truncate the format down to just the time portion. Since it's been more than three years since I last looked at the code, I can't say why I didn't do one of these things. It may be that the date format object makes this difficult or expensive to do. Or it may be that I got lazy when I got to this portion of the code.
Either of these (generating an error or ignoring the year/month/day) would be an enhancement request. They might make the component easier to use. The absence of either of these is not a bug, however. A bug is an error in acting according to the specification of the component. You may not like the behavior, but the component follows the contract.
You could also argue that the documentation is unclear. It may be, but the JCalendar documentation includes this sentence "It is possible to pass in a time pattern that displays more than just the time -- this is not advisable since the date portion displayed in the JFormatedTextField will be ignored by the JCalendar component."
Finally, you suggested I should ignore this parameter. Actually, it's there for people to set the format of the time spinner (e.g. 12-hour AM/PM or 24-hour or whatever), so it does have a purpose.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Antonio,
I didn't see that you specified in the docs that passing in formats beyond time was inadvisable. Yes, you're right - since you did that, I was violating the contract.
thanks for having taken the time to read/respond to all these posts.
Best regards and merry x-mas.
tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Display a JCalendarCombo and click on it to bring up a calendar/time popup.
Put focus on of the elements of the date/time spinner at the bottom of the screen - say, the month. Then change the month using the spinner control.
Now, when the popup is dismissed, the new date is not reflected in the combobox.
Is this perhaps fixed in a later release? The last release I see in the downloads are is from 2005. Is that the latest?
thanks for any help,
tom wolf
twolf@netforensics.com
Maybe I don't understand your question.
The month "spinner" is for viewing, not setting the month. Actually, you never set the month, you set the day (by clicking on a day) and that sets the day, month and year.
The time spinner is different. Changing the time there will set the time. It is a true "spinner" in that it has a text field with small up/down arrows attached on the right.
The month and year buttons are for navigation, to get you to where you can select a specific day.
I hope this clears up your confusion.
Antonio,
I'm not talking about the month and year buttons - When I used the word "spinner", I really meant it :-)
I can't find a way to attach a screenshot as part of this posting, so I will try to be more precise.
When I click on the JCalendar combo box, a popup appears which has three areas:
1) a Button area for chaning the viewed month or year
2) a "month" area with buttons for each day of the month
3) a spinner that allows the user to change MM/DD/YYYY HH:MM:SS
I'm looking at the spinner at the bottom of the popup and it looks something like this:
12/16/2008 10:36:22<up/down>
You can focus on any of the fields, month, day, year, hour, minute, or second and then use the up/down controls of the spinner to change these. When I focus on on the month, day, or year and change them via the spinner controls, nothing changes anywhere - my listener's dateChanged() method doesn't even get called. On the other hand, if I focus on the time elements of the spinner and change any of them via the up/down controls of the spinner, my dateChanged() method IS called and the new time IS reflected in the combobox when the popup is dismissed by clicking somewhere outside the popup's area.
I hope this clarifies things. The date part of the spinner seems to be absolutely without function. If it's supposed to be doing nothing, it shouldn't be part of the spinner.
thanks for any feedback,
tom
twolf@netforensics.com
Hello, again,
When I look at the documentation, I see a lot of references to a time spinner, but none to a time/date spinner.
The documentation for JCalendar says "The date is selected using a calendar display. The time is selected using a date spinner." While this may not be the clearest way to state it, it appears that dates are not supported by the time spinner. You should limit your time pattern to a time.
If you wanted to select a date without using the calendar, you could use an editable JCalendarCombo.
You could submit an enhancement request to add this capability. To be honest, though, it's unlikely I'll add this unless you also provide working code. It's been so long since I worked on this, that I had to read the documentation to figure out the problem!
P.S. While it appears that you can't attach anything in Forums, you can attach files in the Trackers.
Hi Antonio,
Thanks for taking the time to respond to my questions.
The code I use to instantiate JCalendarCombo is very simple:
datePicker = new JCalendarCombo(Calendar.getInstance(), Locale.getDefault(),
JCalendarCombo.DISPLAY_TIME | JCalendarCombo.DISPLAY_DATE,
false, "MM/dd/yyyy HH:mm:ss");
When this is added to a panel, you'll see a combobox that includes date and time. When you click on the drop-down, you will see a popup that includes a single spinner via which to adjust both the date and time. The bug is that the date adjustments have no effect whatsoever. That's really a bug, not an enhancement.
If nothing else, I was hoping that at least an event would get generated - this way I can at least do something when the user does something with the spinner (assuming I have access to the spinner's current content).
I can try to find the "Tracker" you speak of (never used sourceforge much before, so I don't know my way around yet) to upload an image of what I'm talking about, but hopefully my explanation was good enough.
If you don't have the time to fix it, I'd be happy to look into the problem, but I have never looked at the source code, so it would take me probably a much longer time to find/fix the issue than it would take you.
Antonio,
I just registered as a user on sourceforge and tried to submit a bug so that I can attach the screenshot of the JComboBox as I see it. But the system says that only members of the project can do this? Maybe I'm missing something obvious?
thnx,
tom
Hello, Thomas,
There's nothing special about my setup on SourceForge, so keep in mind you have all the resources available to any SourceForge user to help you in entering a bug. As always, Google is your friend.
That said, go to Tracker and then Feature Requests (this is not a bug, in my opinion) and look around for the word "Add". I just noticed that there's a new Tracker interface and the terminology is now "Add an artifact".
As for whether you have to be a member of the project: I am the only member and somehow others have managed to report bugs and ask for enhancements, so I assume it's possible. I am also not in the best position to test whether the staff at SF have done something to block bug postings.
Finally, with regards to your statement—"If you don't have the time to fix it, I'd be happy to look into the problem, but I have never looked at the source code, so it would take me probably a much longer time to find/fix the issue than it would take you."—thanks for the offer to look into this enhancement.
Your assumption about how long it might take for me to do this vs. you is not correct. First, it's been years since I wrote the code. I don't write Java code much these days. Second, I don't consider this a bug, so it's not something I feel any need to fix. Third, I'm not sure it's even a good idea. I have a vague memory that I tried doing something like this at one point and discovered some nasty side-effects and decided to stick with just the time spinner for time selection and the calendar for day/month/year selection.
If this feature is important to you, you will have to code it yourself. If it works really well and you'd like to share it with others (as I've shared my code with you), you can send me your working code for me to try out. If I agree that it improves the component, I'll incorporate your code and provide you with a credit.
Good luck!
Hi Antonio,
I think you're still misunderstanding my explanation. In your posting you say:
"...Second, I don't consider this a bug, so it's not something I feel any need to fix....and decided to stick with just the time spinner for time selection and the calendar for day/month/year selection."
But you are NOT simply using a "time spinner" for time selection! The JCalendarCombo I described before brings up a popup that has a single JSpinner that shows a date and time AND WHICH LETS YOU SPIN EITHER THE DATE OR TIME COMPONENTS.
A user can spin the month - but it has no effect when the popup is dismissed. A user can spin the hour - and it does take effect when the popup is dismissed. Two different outcomes when spinning two different parts of the same spinner. Seems like a straight-forward bug to me. If you didn't want the user to manipulate the date via the spinner, then the spinner should not include the date.
I downloaded the code - perhaps, if that was your intent, I will try and change the code to do just that (have the spinner just show the time).
I will try to file this bug in tracker as you suggest - perhaps you're just not remembering the look of the popup and an annotated screenshot would explain better than any words.
Antonio,
I looked at the source code and the problem lies in the fact that I'm using the JCalendarCombo constructor whose last argument is the "timePattern" format string. I was passing in the same formatting string that I subsequently use for the JCalendarCombo.setDateFormat() - a format string that includes mm/dd/yyyy. Your constructor then sets a "timePattern" class variable that is later passed to SpinnerDateModel that drives your JSpinner.
Anyway, if your intent is to not let the user modify dates on your spinner, perhaps the solution is to ignore that parameter on the constructor. But it's up to you - since I can simply pass in NULL, I have a workaround.
Thanks though for listening to my postings. And thanks for the component!
best regards,
tom
Sorry about your frustration, but I did understand your problem, even if I was not making that clear to you.
I know that you were passing in a format that included the year/month/day where you should have been passing only a time format. This is not a bug: garbage in, garbage out. The contract for this function requires that the format be just a time value. Violate the contract and you're on your own.
You could argue that I should generate an error message or somehow truncate the format down to just the time portion. Since it's been more than three years since I last looked at the code, I can't say why I didn't do one of these things. It may be that the date format object makes this difficult or expensive to do. Or it may be that I got lazy when I got to this portion of the code.
Either of these (generating an error or ignoring the year/month/day) would be an enhancement request. They might make the component easier to use. The absence of either of these is not a bug, however. A bug is an error in acting according to the specification of the component. You may not like the behavior, but the component follows the contract.
You could also argue that the documentation is unclear. It may be, but the JCalendar documentation includes this sentence "It is possible to pass in a time pattern that displays more than just the time -- this is not advisable since the date portion displayed in the JFormatedTextField will be ignored by the JCalendar component."
Finally, you suggested I should ignore this parameter. Actually, it's there for people to set the format of the time spinner (e.g. 12-hour AM/PM or 24-hour or whatever), so it does have a purpose.
Antonio,
I didn't see that you specified in the docs that passing in formats beyond time was inadvisable. Yes, you're right - since you did that, I was violating the contract.
thanks for having taken the time to read/respond to all these posts.
Best regards and merry x-mas.
tom