How to disable (grey-out) the ticks of a JSlider?

Hi everyone,
In my GUI, I have a JSlider that I want to be disabled (greyed out)
because it should be only actived on my application next version.
(It is important though to have it to preserve GUI appearence).
Problem is that I was unable to greyout the ticks even though
already managed to grey out the slider and the number labels.
Right now, it is pretty uggly to have a partial disabled slider,
because due to ticks not being disabled.
Questions:
1) Does anyone have an idea of how to do it?
A small part of my code is shown below:
JSlider dynSl = new JSlider();
dynSl.setMajorTickSpacing(1);
dynSl.setValue(0); //Default
dynSl.setMaximum(7);
dynSl.setMinimum(0);
dynSl.setPaintLabels(true);
dynSl.setPaintTicks(true);
dynSl.setFont(new java.awt.Font("Dialog", 0, 9));
dynSl.setSnapToTicks(true);
dynSl.setEnabled(false);
// small code just to put the numbers of the slider smaller
Enumeration enum = dynSl.getLabelTable().elements();
while (enum.hasMoreElements()) {
JLabel elem = (JLabel)enum.nextElement();
elem.setFont(new Font("Dialog",0,8));
elem.setEnabled(false);
2) If not possible, how do I change the colour of a JSlider (including
the Ticks)?
My idea is to change Slider's colour to the same grey colour one used
to disable it, making at the end the slider look as if it was disabled.
Thanks in advance,
Jorge

Hi again,
Thanks for the help.
I was trying to avoid not having the ticks at all but it seems to be
the best choise because I could not solve the problem of greying out
them.
I did some more troubleshooting though and for my surprise, if I use
the same code alone, i.e, a simple frame with just the slider it works
fine. I even thought that it was related with having Windows LnF as
opposed to Metal (Java) LnF, but that was not the problem.
The only thing it comes to mind, is that there may be some problem by including the slider on a GridBagLayout !?!?!?
Anyway,
What has no simple solution, solved is! :-)
Jorge

Similar Messages

  • How can I grey out the 'Next' button until a user clicks 'Submit'?

    Hi guys,
    despite how I say it or display it in slides, users don't read the instructions before the quiz. This results in them doing the quiz and then asking me why they scored zero when they answered all the questions. So my question is, how can I disable/deactivate/grey-out the Next button until a user clicks Submit after answering the question?
    I've got Captivate 6.1 on a Windows platform.
    Advice appreciated.
    Carl

    Hello Rod,
    thanks for your answer - I should think more laterally in future.
    In my testing, another question has arisen - how do I get the Next button behind the Clear button? It sounds stupid but I can't get the Next button behind the Clear. I go in to the Master Slide, click on Next to highlight it, and then move it either by the mouse or with the arrow button so that it sits under the Clear button. While Next is still highlighted I click on the button in the toolbar 'Send selected objects backward' to be sure, so that I see 'Clear'. When I go back to the Filmstrip, all I see is 'Next' and when I preview the slides all I see is 'Next' - what am I missing here? What have I failed to do? What am I not understanding?
    Advice appreciated.
    Thanks

  • How to disable (grey out) button in report

    Hi,
    Can any one; pls help how to disable button (grey out) on some specific condition.
    I have a report of 2 pages; In first page it displays few records; once click on specific record control goes to next page 2; And here i have button (template based button); Once click on this it perform pl/sql procedure.
    My requirement is: The button should disable (should not hide) when moves from page 1 to page 2 based on some specific returned values in page 2.
    I have return code in button conditions (Condition type = PL/SQL Function Body Returning a Boolean)
    Sample code is:
    if :value1 = 'disable_test_value' then
    return false;
    else
    return true;
    end if;
    The above code is working fine with button completely disappers if the :value1 = 'disable_test_value' (which is suppossed to be as we gave return false).
    My question is: Is there any way; we can still show button (but button disabled or grey out; so that no action can perform on this button )? And also show some text message in other text field when button is disabled?
    Thanks!!
    UK

    I have an example: http://apex.oracle.com/pls/otn/f?p=27168:1 using theme #2. You need to use a theme that has a "grayed-out" alternate button template.
    To accomplish this I:
    1) Created one item named P1_VALUE1 to contain the condition as to whether the button should be enable ("enable_test_value") or disabled ("disable_test_value").
    2) Created an enable button with a "Button Style" of "Template Based Button" with "Button Template" value of "Button". I had the "Condition" type of "PL/SQL Function Body Returning a Boolean" to be:
    if :p1_value1 = 'disable_test_value' then
    return false;
    else
    return true;
    end if;I had the "URL Target" to be: javascript:alert('Performing function ...');
    3) Create a disabled button with "Button Style" of "Template Based Button" with "Button Template" value of "Button, Alternate 3". I had the "Condition" type of "PL/SQL Function Body Returning a Boolean" to be:
    if :p1_value1 != 'disable_test_value' then
    return false;
    else
    return true;
    end if;I had the "URL Target" to be: javascript:alert('Performing function ...');
    Mike

  • BADI/user exit for me22n - disable/grey out field quantity (MEPO1211-MENGE)

    Dear all SAP gurus,
    When changing PO (ME22N), I need to disable (grey out) the quantity field on item (MEPO1211-MENGE), when all scheduled quantity is already received (EKET-MENGE = EKET-WEMNG).
    Have tried using LMEIGICJI and Handle_event method in CL_SCREEN_VIEW_MM. But still doesn't go to the screen that wants to be disabled.
    Tried using BADI ME_PROCESS_PO_CUST, but couldn't find how to disable the quantity field.
    (IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM only works for custom field).
    Please kindly advise
    thanks in advance

    Hi Ahmad,
    No need of ABAP, follow this IMG Path.
    Material Management -> Purchasing - Purchase Order ->  Define Screen Layout at Document Level
    After Executing it . Choose ME22 from list and then choose display icon.
    than double click Quantity and Price here uncheck opt. Entry and check display.
    save your work.
    Hope this works.
    Regards
    Ahsan

  • How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?

    How do you grey out/disable fields under a radio button if another radio button is selected in Adobe Acrobat XI Pro?
    I’m creating a form where the user has three options to make a payment.
    1. charge to my credit card
    2. charge associated costs to bank account
    3. By cheque or money order
    My Problem is, under each option, there are required fields that has to be filled out. So if the user picks the first option, charge to my credit card, they would fill out the required fields (credit card number, expiration date etc.). But when they click submit button to submit the form, it won’t let them, because there are required fields under the second option. Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it. So what I'm trying to do is this: If the user selects the radio button for option 1, the other two options are greyed out/disabled. And if the user holds down the shift key and clicks radio button for option one again, it unchecks the radio button and the other two options are available again. Is there a way to grey out or disable the two other payment options when the other one is picked. I’m assuming I will have to use javascript, but what would the coding be and which field do I write it under?
    Thanks in advance guys

    You will have to use custom JavaScript to access the various properties of the field object.
    The radio button group has a value. When no button is selected that value is "Off". When an individual button has been selected the value for the group will be the option or export value for that individual button.
    Once you have determined the button selected, then you will know the form fields that need to be made required. You use JavaScript to access those fields and change the "read only" property to false, and set the "required" property to true. For the fields associated with the other options, those fields should be reset, made read only, and have the "required" property set to false.
    Disabling (graying-out) Form Fields
    >> Also, I have the radio buttons for the three options setup so that if the user holds the shift key and clicks a radio button, it unchecks it.
    Radio button in a PDF do not work that way. Only check boxes can be unchecked by clicking on one that has been checked.
    If you plan the coding for the Mouse UP action to test for all possible options and code for each of those options you should have what you want.
    If you want actual code you need to provide a lot more details.
    It is even possible to perform some credit card and bank routing number validations with JavaScript and some check digit formulas.

  • How do i synch my pdf/books to my library. I was able to synch my ipod touch purchases by transferring them but can't figure out how to do my pdfs. Also why is my ipod picture greyed out-the one that lets my move the icons around.

    How do i synch my pdf/books to my Itunes  library. I was able to synch my ipod touch app purchases by transferring them but can't figure out how to do my pdfs. Also why is my ipod picture greyed out-the one that lets my move the icons around.
    I am afraid if i don't get the pdfs into my book library, i will lose them when i update to IOS 5-is that true?

    thank you-i have to check into the authorization and the account-i gave my husband my old ipod when i updated last year so both at one time have been on this computer but as it stands, it only comes up with my device when i plug into Itunes.
    i don't think i have any restrictions for installing apps although my normal way of doing it is to download from the ipod touch. i did find that all i had to do was right click on my device name and got the message to transfer my apps and then they showed up in my library. Also when i clicked the synch checkbox i was able to view the ipod touch picture without it being greyed out. after all that i was able toupdate to IOS 5 successfully except my videos and podcast, and pdfs  did not come over. This confuses me since i had dragged them over to my library to make sure that i had everything in my library and on my device. Not a big problem, since i just dragged them in itunes from my library to my device but sometimes i wonder if i understand the big picture:)

  • How to Grey out the field "tracking number" during change mode in the order

    HI Expert,
    How to grey out the Tracking number (AFVGD-BEDNR) at Order -> Operation tab -> external tab ->tracking number.
    during creation IW31 = not grey out and allow entry.
    for change mode IW32 = grey out
    if i set grey out at config OIOPD, it will grey out even during creation mode.
    Please advise
    Thanks
    Regards

    Hi
    I think Using field selection it is not possible to make as display ,kindly check with screen or transaction variant -SHD0
    regards
    thyagarajan

  • How to disabled (grey) the menu's options in the LaBVIEW window?

    HI,
    I would like to disabled (grey) all the menu options (e.g: File, Edit, Operate, Tools, Browse, Wndow, Help) in the LabVIEW window.
    Note: This when the program is ready for users. I would like them NOT to be able to see these menu options.
    How can I do this?
    Kind Regards,
    Amaloa S.

    Hi,
    Thanks!
    This helped!
    Kind regards,
    AS

  • My daughter forgot her pswrd on her touch it is disabled how do i find out the pswrd or reset??? help someone

    my daughter forgot her pswrd on her touch it is disabled now how do i find out the pswrd or reset it??? please help me

    Sorry, but there's no way to discover the passcode. You'll need to perform a restore on the iPod:
    http://support.apple.com/kb/ht1212
    Regards.

  • How do I grey out outlook 2010 & 2013 Signature Options

    Hello,
    I know by using the administrative templates for outlook 2003/2007 that you can disable, or grey out the ability to make changes to your signature. Our company is looking to deploy a template signature, and we want to have the ability to disable users from
    changing their signatures. We are using Office 365 for e-mail and outlook 2010/2013. Obviously if the user wants to edit their signature to each e-mail they write (manually) we can't control that.
    What I am looking for is a way through group policy, local registry settings or something else that will allow us to disable users from changing signature settings. The only setting similar to this for the ADM Templates for 2010+ is to completely disable
    signatures, which we obviously do not want.
    Please let me know if you have any other ideas/suggestions.
    Thank you!

    You can disable many commands using DisabledCmdBarItemsList - this is in the GPO under Outlook  > disable Items in user interface > custom 
    HKEY_CURRENT_USER\Software\Policies\Microsoft\office\15.0\outlook\DisabledCmdBarItemsList
    String name: TCID1 (where 1 is incremented for each command you want disabled) 
    The value for the Insert Signature command on the ribbon in forms is 5608 but I didn't see any other signature commands on the list - and it doesn't disable the right click, choose signature command. A spreadsheet with the command id's is here - http://www.microsoft.com/en-us/download/confirmation.aspx?id=6627
    http://www.slipstick.com/how-to-outlook/group-policy-disable-commands/
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • How do you grey out a radio button if a text field is blank in Adobe Acrobat XI Pro?

    How do you grey out a radio button if a text field is blank in Adobe Acrobat XI Pro?
    So this what I'm trying to do:
    (     )   |TEXT FIELD|
    (     )   |TEXT FIELD|
    (     )   |                  |
    (     )   |TEXT FIELD|
    I have a radio button: (     )
    and a text field: |TEXT FIELD|
    The third text field is blank, and I would like for the radio button next to it greyed out (user can't click on it) since the text field is blank. Is this possible to achieve? I'm assuming I'll have to use javascript, but what would the code be and would it be entered in the javascript editor for the text field or the radio button?
    Thanks in advance guys

    Hey, thanks, but it didn't work
    I have the text fields as read only. Could that be why it's not working? Should I make the fields not read only?
    Thanks,

  • How do I grey out info per line item on a actioned Purchase Requisition ?

    Hi:
    Can any one please tell me how do I grey out all information for a line item (and all other relevant information for that line on the requisition) on a already actioned  Purchase Requisition /  PO.
    i.e. Although PO is already placed for a requisition, user still changes dates, qty's ect on that line item and we want to prevent this.
    Many thanks.
    W.

    Hi
    Check it in OMCQ
    Convert the message "06 152 Purchase orders already exist for this item" into error item.
    If u still want anybody to change the PR itself... if can be controlled via release indicators...
    Check the release indicators for PO/PR, maintain the "changebale"
    Check this also
    Regards,
    Raman

  • How can i print out the waveform chart?

      hello everybody,
    how can i print out the "waveform chart". can i do it just push the button. ( example; stop button is stop the program etc..)
    i checked the NI examples but i can't understand. i'm new to the Labview.
    pls help me.
    i added the my program
    look forward your reply
    regards from turkey...
    Message Edited by hknmkt on 05-29-2008 04:15 AM
    Attachments:
    29.05.2008_11.vi ‏37 KB

        hi jim,
    i tried the program but it's not running. When i run the program, it's print out without run the program
    i added the printed file.
    look forward your reply
    hakan
    Attachments:
    error8.JPG ‏8 KB

  • How can I find out the dpi of an image in Acrobat.

    How can I find out the dpi of an image in Acrobat. I have tried the pre-flight option but I really don't understand the pixels width x depth information that I get. I basically just want to know at dpi of a single image. Is there other program that will read my pdf file and tell me this information.

    Thank you, tylerdurdain! That was ridiculously difficult to find. Not sure what version of Acrobat you're using in your image, but for those using Acrobat Pro 11 (in Mavericks), it's buried under View > Tools > Print Production.
    That opens a panel on the right.
    To keep from having to chase it down this way each time, right click on "Output Preview" and choose "Add to Quick Tools Toolbar". That adds a button to the top right of the toolbar.
    Now you can call up the inspector with one click. Choose Object Inspector as tylerdurdain shows above, then click on the item displayed to get its properties.

  • How can I find out the overall time and not only the time of a single clip?

    I have set up two cameras in one room. Both cameras record the same thing from different perspectives at the same time. I have found an interesting scene for video 1 (recorded by camera 1). Now I would like to find the time at which the interesting scene takes place in video 2.
    However, I have not seen any way to get displayed, at what time the scene starts in relation to the total length of the video (e.g: scene starts after 5 minutes from total 10 minutes).
    The indicated time refers only to a part of the clip and not to the overall project, even if a special clip is not selected. Does anyone know, how I can find out the time?

    Go to Settings>iCloud>Storage & Backup.  It will be shown just below the Back Up Now button at the bottom.

Maybe you are looking for

  • How Many Different Computer Can I Install my Creative Cloud Account On?

    I originally downloaded Creative Cloud for my laptop and use on the in class and on the move. But I also have a desktop at home and I heard I could possibly download it again on my desktop so I was wondering if this was true and how worked? Thanks

  • Upgrade from win 7 to win 8.1 issue

    I updated my win from 7 to 8.1 my WiFi adapter is not able to identify network. prior to upgrade when i was in win 7 it was working. Can some guide with troubleshooting steps that i can do. I did uninstall the network adapter couple of times but no l

  • Can,t redeem funds in my account!

    I started an account a couple of years ago and used my cc to purchase a few tunes. I have since recieved some gift cards and i redeemed them. My account shows i have 30.05 in my account from the gift cards.But every time i buy a song it just charges

  • Disk Full Alert

    Hi - I'm running 10.4.11 on Dual 2 GHZ PowerPC G5. I have 2 GB DDR SDRAM installed and 30 GB of free space on my hard drive. I keep getting a Disk Full Alert saying that "your Mac OS X start up disk has no more space available for application memory.

  • Portlet required for WLPS7.0  which is equivalent to WebPage Portlet/WebClipping portlet of Websphere Portal Server4.1

    Hi All, I am searching for an available portlet for WLPS 7.0 which is equivalent in functionalities to Webpage Portlet/Webclipping Portlet of Websphere Portal Server4.1 (IBM). On specifying URL this portlet should be able to get URL's screen in the p