Hopefully easy answer. How can I get a slider to only have integer values?

I'm trying out a slider from the example page to let users chooice 5-100, but the slider also lets values be doubles. Is there any way to limit the slider to only lock on to values when they're doubles?

This seems to work, the code below forces the slider position to be a power of 2 (1,2,4,8,16,32,64,128).
new Slider(1, 128, 64) {{
        valueProperty().addListener(new ChangeListener<Number>() {
          @Override
          public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
            double value = (Double)newValue;
            int closestPowerOf2 = (int)Math.round(Math.log(value) / Math.log(2));
            if((int)value != (1 << closestPowerOf2)) {
              setValue(1 << closestPowerOf2);
        setMajorTickUnit(25);
        setShowTickMarks(true);
        setShowTickLabels(true);
}};

Similar Messages

  • I need to erase all Contents and Settings from my i phone 5 but I forgot the restrictions passcode. How can I get it. ( Idon't have access to i tunes). Thanks.

    I need to erase all Contents and Settings from my i phone 5 but I forgot the restrictions passcode. How can I get it. ( Idon't have access to i tunes). Thanks.

    Not possible.  You need access to iTunes.
    The passcode will be required to make changes to these settings or to disable Restrictions. Note: If you lose or forget a restriction passcode, you will need to perform a factory restore to remove it.
    The above comes from here:
    http://support.apple.com/kb/HT4213

  • Since I joined creative cloud, I have not been able to sync. Why the difference? Worked good during initial trial. Also I had installed the Mosaic app before Lightroom mobile came out and I cannot seem to get rid of it. How can I get mosaic out? I have ca

    Since I joined creative cloud, I have not been able to sync. Why the difference? Worked good during initial trial.
    Also I had installed the Mosaic app for ipad before Lightroom mobile came out and I cannot seem to get rid of it. How can I get mosaic out? I have cancelled, I have deleted, I have looked through the files for visible remnants.

    The sync count is 60 and static. The total number synced so far is 500+. None have been synced from the ipad except for corrections made there on those already synced.
    I have deleted the Mosaic app from all machines and checked the library folder and have contacted the Mosaic tech support and they have discontinued my subscription. I still get mosaic messages on initiating Lightroom and sometimes at closing.
    I have not tried to sync fewer yet, but some catalogs that I have tried are smaller numbers. Initially, it did well on good connections. Nothing works on my home connections over satellite.

  • I had to reset my ipad and 3 mivies rented dissapear. how can I get it again if i have not watched yet?

    I had to reset my ipad and 3 movies rented dissapear. how can I get it again if i have not watched yet?

    You can try contacting iTunes support and see if they will grant you a  re-download of them : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I have problem with the security question which i forgot the answer how can i change it as i already have apple id and password

    I have problem with the security question which i forgot the answer how can i change it as i already have apple id and password

    You may reset the password on your account by opening https://iforgot.apple.com/ in Safari and entering your Apple ID (your email address, which the moderators should have removed earlier).
    You won't be able to set the password to your email address, or a recently-used password (if I remember correctly).
    Once you change your password, you should update your password on your iOS device in Settings > iTunes & App Store, then tapping the "Apple ID: <username>" cell at the top to re-enter your password.  (Your iOS device may prompt you for the new password before getting to Settings as well.)
    Hope that helps.  If you have a different issue, please post a follow-up message.

  • How can I get the music that I have on my iPod onto my PC?

    I've never used iTunes on the computer before. I always just used it on my iPod to download songs. Now I've signed into iTunes on my PC, but I don"t have a single on of my songs... How can I get them?

    Follow the instructions here or here.
    (118696)

  • HT201302 how can i get my videos i only get pictures from i cloud but no videos please help

    i need help i cannot find my videos from i cloud when i put a back up file to my i pad mini i only get pictures but no videos how can i get those videos please these are very important videos my sons birthday video thanks

    You can use iTunes on your computer if they have the same account.
    Otherwise you can use the Dropbox App to transfer files between your devices; http://db.tt/VCNzkXr

  • TS1410 By mistake I disconnected my iPod Classic when it said Do not disconnect. Now it doesn't appear in iTunes, but it does appear on my desktop. How can I get to reappear in iTunes (have tried resetting and rebooting).

    By mistake I disconnected my iPod (5th generation) when it said Do not disconnect. Now it doesn't appear in iTunes, but it does appear on my desktop. How can I get to reappear in iTunes? I have tried resetting and rebooting. And my iTunes is up to date on my macbook pro, mountain lion, OS X 10.8.
    Thank you!

    The iPod's filesystem may be corrupted.  This may seem like overkill, but it has been known to help many others in the same boat.  Try doing a low level reformat of the iPod's hard disk using the instructions in this article.
    http://www.methodshop.com/gadgets/ipodsupport/erase/
    B-rock

  • Some of the tools have disappeared from my tool bar in PS CC.  How can I get them back?  I have burn but dodge has disappeared.

    The deeper levels of tools have all disappeared from my Tool Bar.  Clicking on the arrow beside the tool does nothing?  How do I get them back?  I have restarted both Photoshop and my computer and this does not help.  Thanks.

    Try "Reset All Tools"  Right-click on the Hand Tool in the Options bar, or whatever tool is active, and click on Reset all Tools from the menu.
    This screen shot will show you where that is.

  • How can I get Expose to show only and all active windows, regardless of app

    Sometimes I have two applications running with several finder windows hidden on the dock. I'd like to know how I can (or if I can) get Expose to show only the Active windows - not the ones on the dock. With this new upgrade, it seems that all open windows that are on the dock appear in a row at the bottom of the screen, which takes up real estate - can I turn that function off so just the open, undocked windows of all apps show?

    Sounds like you opened a message in a new window. Have you tried closing that window and see what happens?
    If that is not it maybe you can post a screen shot of what you are seeing.

  • My ipod was stolen how can i get it back? i have the app find my iphone and i have gone on the mobleme website but it might need to be replaced, could i get any kind of discount? it was a 32GB ipod 4.

    My ipod has been stolen and i may need to get a new one i do not know what to do please help!

    Find my iPhone is relatively useless when it comes to recovering a stolen device. Anyone with a bit of know how can defeat it in a matter of minutes. It's really meant  to help a person find a misplaced device.
    Presume that any and all data and info on that device is compromised, do as Illass says, change any and all passwords to every account or site you accessed on the device and write it off as gone.

  • How can you get photos back once you have deleted them?

    Can anyone tell me if or how you can get photos back once you have deleted them from your ipad2??  I accidentaly deleted some very important pics. Please help!!

    iPad Photo Recovery: How to Recover Deleted Photos
    http://www.iskysoft.com/iphone-data-recovery-mac/ipad-photo-recovery.html
    How to Restore Lost or Deleted Files from iPad
    http://www.iphone-ipad-recovery.com/recover-ipad-mini-files.html
    How to Recover Deleted Files from iPad
    http://www.kvisoft.com/tutorials/recover-deleted-files-from-ipad.html
    iSkysoft Free iPhone Data Recovery
    http://www.iskysoft.com/iphone-data-recovery/
    Recover iPhone/iPad/iPod touch lost data, Free.
    Free recover iPhone/iPad/iPod touch lost contacts, photos, videos, notes, call logs and more
    Recover data directly from iPhone or from iTunes backup
    Preview and recover lost iOS data with original quality
     Cheers, Tom

  • I recently had to reinstall itunes to my computer. Now, not all of the music that i purchused is in my library. How can I get it back? I have tried looking at recent purchuses in the itunes store but, it's not showing any of the missing music there either

    How can I retrive music that I know that I have purchased but, the music does not show up in my recent purchases?

    Hello there, Bevo2274.
    The following Knowledge Base Article has great pointers on how to get your purchased music back to your iOS device:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/HT2519
    Specifically the section under "Apps, Books, Music, Movies, or TV shows on iOS":
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro D.

  • TS1436 memory not sufficient error message how can i get rid of it, i have plenty of space on my disc

    i get a error message saying that i don't have sufficient memory to upload music from my own cd library? what is going on? how can I change this, i have like 2 Terabytes of space on my hard drive? can someonw help me resolve this issue?

    Maybe if the exact error message was provided someone could offer a relevant solution.

  • How can I get Time Machine to only backup new and changed files?

    Time machine is backing up more than just new and changed files and is filling up my back up disk too fast.  How can I change it so that it will only back up the new or changed files instead of the whole drive?  I used to have my backups go back months, but now it is backing up only a couple days back, since there is no room left on my back up hard drive.  Each back up is like 400 gigs, instead of just the amount of the changed or new files.
    Thanks for any ideas or help!
    kt

    Thank you Eric!  I did go look at this info and tried to do a full reset of TM and I am still getting full backups of my HD instead of just new/changed files.  The weird thing is that I have 9 BU's from over the last 2 days and they all seem to be around 415 gigs and my backup HD is only 750 gigs!  I don't get it.  It shows that I have around 75 gigs of free space on that 750 gig drive.  It doesn't make sense.
    So I am having the same problems even after doing the full reset of TM. I am using Mavericks 10.9.5 which they don't talk about in this info.
    Does anyone have any further ideas on this?  I don't understand how I could possibly have that many full BU's on my HD that is only 750 gigs.
    Thank you,
    kt

Maybe you are looking for

  • Problem with Application server 8

    hi guys , i am using Application server p.e 8 and i'm not able to start the default server it gives the following error: Starting Domain domain1, please wait. Log redirected to C:\Sun\AppServer\domains\domain1\logs\server.log. Domain domain1 failed t

  • Periods between two dates .

    Hi, can anyone tell me any function module dat returns the no of periods between two dates .like if i enter 02.02.2007             05.05.2007 then it shud return periods . 011 012 001 002 003 thnx , point will b assigned.

  • OMBPLUS: retrieve type of operator?

    Hello, i have to determine via ombplus, if an operator is a table, aggregator, filter and so on. For this, I'm looking for the key of that property. "OPERATOR_TYPE" is not the correct key and I don't know how to get a list of possible keys. OMBRETRIE

  • Pre-compilation

    Is it with WLS 4.5.1 possible to automatically pre-compile all JSP pages without having to do it manually for each one of them from the command line?           

  • Netbios Name query injected into socket connect.

    Folks, I have a java application which communicates to a networking device via sockets. It was written with J2SE 1.4, I have ported it to 1.5/5.0. When issuing a socket connect, I observe that the application/JRE is issuing several Netbios Name queri