Can't make an alarm that is set more than 24 hours in future with JSpinner

I have what I thought was a simple problem, but I can't seem to get past it, so I come to ask the experts.
I want to use a JSpinner to basically set an alarm. I am using the SpinnerDateModel and a DateEditor with the string "HHH:mm:ss". The reason there is three hour feilds is because what I really want is to be able to set it to any number of hours from 0 to 999. But there in lies my problem, it won't let me get past 24.
What I have tried:
I changed the first H to D (or d, whichever is days in the year) but it wont work for me because it can't be zero.
I tried extending the DateEditor code, but this was next to impossible because the company I work for makes us have two machines on our desk, both are thin clients, one connects to the internet but we are not allowed/able to download anything, and it does not have java on it in any form. The other does not connect to the internet, and can not, it has Java on it, but not the source code for methods like DateEditor. So without seeing the source I have no clue what to override.
I really want to use the one JSpinner with the SpinnerDateModel, but if I can't figure this out then I could use seperate spinners for hours, minutes, and seconds though that looks really ugly and is far from ideal.
So please if anyone has any clue how I could solve this, please let me know.
Thanks,
JSG
Edited by: JustSomeGuy on Jun 29, 2010 2:00 PM

I just tried out a JSpinner with the SpinnerDateModel and DateEditor using pattern "HH:mm:ss". Behind the scenes, you are still dealing with a date. If you look at what date gets returned, the first time you spin the spinner using that pattern, the year suddenly jumps to 1970. It's using a default year, because there is no year to spin within your pattern.
So long as you don't feel too guilty or uncool for using the date spinner in a manner that it was not intended, you could probably achieve your objective by abusing the date editor with a pattern like "SSS:mm:ss". That pattern is milliseconds (which conveniently go from 0 to 999), minutes, then seconds. When reading your spinner, just interpret the milliseconds as the hours, minutes as minutes, and seconds as seconds. The rest of the date just gets thrown away. Uncool. But should work.
Or you can be cool and write a custom editor and model, but depending on your experience level, this could be difficult and time consuming. But also comes with a greater feeling of achievement.

Similar Messages

  • Hello-- I'am thinking off making an app to the iphone, but i'am not sure aboutsomething. the app should get some alarms from a specific phone number, and my question is, can i make an app that can receive message from a specific phone number ?

    Hello-- I'am thinking off making an app to the iphone, but i'am not sure aboutsomething. the app should get some alarms from a specific phone number, and my question is, can i make an app that can receive message from a specific phone number ?

    This needs to be asked at http://developer.apple.com/

  • How can i make a photo that is 10 x 6.6 to 10 x 8 without changing the image in Photoshop CS3?

    How can I make a photo that is 10 x 6.6 to 10 x 8 without changing the image in Photoshop CS3?

    I could be snarky and say change the image in a different version of Photoshop, but NO...
    The only way to make a photo that is one size into another size is to change the image.  You have a few choices about how to change it:
    One way is to simply expand the height from 6.6 to 8 inches using Image>Canvas Size, using the default setting of having the image centered and leaving the background either black or white, your preference.  This will add background color to the top and bottom of your image.  This won't change the image itself, but it will change its surroundings.
    Another way is to resize the image using Image>Image Size, entering the new dimensions after turning off the aspect ratio lock (resample on).  This will stretch the image vertically, however, so it's probably not a good option.
    Finally, you could resize the image using Image>Image Size, leaving the aspect ratio lock on and resample on, and increase the height from 6.6 to 8.  This will have the secondary effect of enlarging the width from 10" to a greater width.  Then you crop the resulting image back down to 10" width, which involves losing some edge areas of the image.

  • How can I make a button that on press the object appears and on second press the object to disappear

    Hello,
    I'm quite new to flash programing, and I don't know how can I make a button that will make the object appear and disappear.Till now I have this code for the appear:
    on (press)
        _root.top1.gotoAndStop(2);
        _root.topp.gotoAndStop(2);
        _root.mm1.gotoAndStop(2);
              _root.m1.gotoAndStop(2);
    but from here I'm stuck.
    Thank you for your help

    What you can do is use the _visible property of the object to make it appear and disappear, or more correctly, use the opoosite of the _visible property.  You should not put code "on" objects, keep it in the timeline.
    If "object" is the instance name of the object you want to toggle, then in the timeline code you can use...
    object._visible = false;  // start with the object being invisible
    yourButtonName.onRelease = function(){
        object._visible = !object._visible;
    That one line in the function sets the object's _visible property to be the opposite of what it currently is.

  • How can I make it so that my songs don't go on her iPod and her songs ....

    Me and my mother just got iPods for christmas and hers was a U2 ipod and mine was a 30gb ipod. I have downloaded some songs and have imported some cds but my mother doesn't want those songs on her ipod. How can I make it so that my songs don't go on her iPod and her songs don't go on mine.Do i need to create another itunes?

    The computer can tell the difference between your two iPods. When you first plugged each one in, you named them and the computer recognizes each one as a separate disk.
    Now, when you plug in your iPod, and you are looking in iTunes at your iPod contents, you will see four buttons in the bottom right corner of iTunes - the first one is to display iPod options. Click on this, and under the music tab, select "Automatically update selected playlists only". Then, you scroll through your playlists and select only those you want to be transferred to your iPod. Your mother can do the same thing. Now you can each make your own playlists from the same music library, and only those songs you want to go onto your iPod will transfer when you plug it in. You can make the same selections for all the other options too (video, podcats. photos, etc), so that you only have to have what you want on each iPod.
    I have two iPods, a new 5g video iPod and an ancient 1g iPod, and have no problems syncing each of them with different playlists and options.

  • When I connect my ipod to my computer it opens my documents and won't show up in my itunes and I have unistalled then reinstalled itunes and reset my ipod twice and it stills does the same thing how can I make it so that it shows up in my itunes?

    When I connect my ipod to my computer it opens my documents and won't show up in my itunes and I have unistalled then reinstalled itunes and reset my ipod twice and it stills does the same thing how can I make it so that it shows up in my itunes?

    Try
    iOS: Device not recognized in iTunes for Windows
    I would start with              
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or              
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    Before you reinstall the Apple software, also remove iCloud vi Control Panel Remove programs. The reinstall the Apple programs
    New cable and different USB port?
    Runs this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Try on another computer to help determine if computer or iPod problem

  • How can I make it so that when Safari opens it takes me to the homepage?

    Say I am on youtube and I quit safari, when I reopen safari later, it goes to the page last open, in this case, youtube. How can I make it so that when Safari opens it always takes me to the homepage?

    Click on the red button (top left) to close the window before quitting.

  • How can i make it so that on messages i can see who is online wihtout having to search their name?

    how can i make it so that on messages i can see who is online without having to search their name? When i had ichat i didnt have to search their name... i culd see who was online autimatically.

    Firefox, the web browser, doesn't make any decisions about what mail should be considered spam or what senders should be blocked. What email software or webmail site are you using that is rejecting the messages?
    If it's a common site like Yahoo! mail, Gmail, Windows Live Hotmail/Outlook.com, then perhaps a volunteer familiar with their specific settings can help.
    If it's Thunderbird, the support site is over here: [https://support.mozillamessaging.com/].
    If your security/privacy software filters your mail, you will want to check its settings as well.

  • HT201365 Now that I have upgraded to iOS 7, how can I make it so that I don't need a password every time I use my iPad?

    Now that I have upgraded to iOS 7, how can I make it so that I don't need a password every time I use my iPad?

    In v6 airport utility "Join a wireless network" is not available once the TC is setup.
    You must reset to factory and try again using the selection options.. and it can fail or not come up.. This is an extremely poor way to setup a TC.. and you should NEVER EVER DO IT.. that is why apple removed it. Since you are joining wireless it makes no difference where the TC is located.. since it would become a dumb AP and turn off its ethernet ports.
    Place it right next to your main modem router, plug in by ethernet, and select bridge mode and create a wireless network. Never use Join a wireless network..
    However for completeness here is the method.
    How do I setup my time capsule with wireless internet?
    Never ever do it.
    If you need internet by wireless and backup to the TC.. then simply plug the TC directly into the Mac.
    Run dual network.. Setup explained here.
    Using Time Capsule hardwired to Mac for back-up only.

  • If I turn off my iPhone, will the alarm that I set go off ???

    if I turn off my iPhone, will the alarm that I set go off ???

    if you turn it off by pressing the button on the top yes
    if you turn it off by holding down the button on the top and sliding the bar on the screen when it appear then no

  • For Cisco SPA112: can I make dial plan that can use 6 digit number without having to dial the area code 00357 but not for 0030?

    Cisco SPA112:
    Can I make dial plan that can use 6 digit numbers without having to dial the area code 00357 but also being able to dial 0030xxxxxxxxxx numbers?

    If you include a country number, you have to drop the initial 0 from the area code. eg +31 10 2345 6789 instead of +31 (0)10 2345 6789

  • When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    mostafa182 wrote:
    ... how I can solve this problem?
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • When opening a new tab, can I make it go to my homepage? Currently "AVG Safe Search" opens with a new tab, I want it gone!

    I downloaded the latest AVG update and with it they were more than happy to hit me with a stupid search bar at the top of Firefox, as well, when I open a new tab it goes to a page that looks like Google but is the AVG Safe Search page. I don't want it to happen! I would like if I could set it so Google home opens when I open a new tab but I haven't been able to find that option.

    Try this?
    * http://www.groomi.net/2010/10/how-to-remove-avg-savesearch-from-firefox-address-bar/
    You can set your own homepage by using this extension
    * https://addons.mozilla.org/en-US/firefox/addon/new-tab-homepage/

  • I am currently running OS X 10.5.8 on my MacBook (early 2008) and want to know if I can upgrade to a version that will allow me to use iCloud to sync with my new iPad?

    I am currently running OS X 10.5.8 on my MacBook (early 2008) and want to know if I can upgrade to a version that will allow me to use iCloud to sync with my new iPad?

    I believe to use iCloud you need to run at least Lion (10.7). (Only the Find My iPhone or Find My Mac parts of iCloud work with OS earlier than 10.7/Lion).
    I think you can run Lion but you should check each of the following:
    "To use Lion, make sure your computer has the following:
    An Intel Core 2 Duo, Core i3, Core i5, Core i7, or Xeon processor
    Mac OS X v10.6.6 or later to install via the Mac App Store (v10.6.8 recommended); you can install without Mac OS X v10.6 by using an OS X Lion USB Thumb Drive, available on the Apple Online Store
    7 GB of available disk space
    2 GB of RAM
    If your Mac does not meet these requirements, you will need to upgrade your Mac before installing Lion"
    You have a Core 2 Duo. You can upgrade to 10.6 and then install Lion, or use the thumb drive approach mentioned above (thumb drive Lion costs about $70 I think). You need to check your RAM to see if you have enough.
    Folks have reported that 4 GB RAM is really a minimum for a decent experience with Lion.
    For Mountain Lion, see this ( http://support.apple.com/kb/HT5444 ) for what you need to have to install OS 10.8. I don't think you can use Mountain Lion (10.8) with your early 2008 Macbook.

  • I can't make any entries in Calendar further ahead than February. Why?

    I can't make any entries in Calendar further ahead than February. If I try to make an entry in March the Calendar shuts down. Why?

    Try removing any all-day events from the calendar for the 1st April 2013 e.g. if you are syncing the calendar from somewhere else (e.g. Outlook on a PC or iCal/Calendar on a Mac) then change it to a timed event instead of all-day (if you don't sync your calendar from anywhere then try going into list view, go to 1st April and change any 'all day' events to times e.g. change Easter Monday to start at something like 4am) - it seems that there is a problem with all day events on that date which is when the clocks change due to daylight saving on the day before.

Maybe you are looking for