How to disable a JCheckBox and leave the text the original color?

When a JCheckBox is disabled, its text gets dim (gray). I need to just dim the checkbox but leave the text the original color.
I can't find the code where the text color changes when the box is disabled...
(I have found the code that draws the square and the box at: com.sun.java.swing.plaf.windows.WindowsIconFactory .)
Any ideas?

Try this checkbox, i think you could customize to achieve exact behaviour:
import java.awt.Graphics;
import javax.swing.JCheckBox;
import javax.swing.JToggleButton;
public class KCheckBox extends JCheckBox
    private boolean clickable;
    private boolean enabled2;
    public KCheckBox()
        super();
        init();
     * @param text
    public KCheckBox( String text )
        super( text );
        init();
    private void init()
        setModel( new MyButtonModel() );
        this.clickable = true;
        this.enabled2 = true;
    public void paint( Graphics g )
        // store existing state
        boolean e = ((MyButtonModel)getModel()).isEnabled();
        // if !enabled - set not enabled
        // otherwise - set enabled
        ((MyButtonModel)getModel()).setEnabledNoFire( this.enabled2 );
        super.paint( g );
        // restore previous state
        ((MyButtonModel)getModel()).setEnabledNoFire(e);
    public void setClickable(boolean clickable)
        this.clickable = clickable;
        super.setEnabled(clickable && this.enabled2);
    public boolean isClickable()
        return this.clickable;
    public void setEnabled(boolean enabled)
        this.enabled2 = enabled;
        super.setEnabled(enabled && this.clickable);
    public boolean isEnabled()
        return this.enabled2;
    private class MyButtonModel extends JToggleButton.ToggleButtonModel
        public void setEnabledNoFire( boolean b )
            if (b) {
                stateMask |= ENABLED;
            } else {
                stateMask &= ~ENABLED;
}Edited by: unvadim on Sep 5, 2008 4:41 PM

Similar Messages

  • I have the same songs showing up on 2 playlists on my Ipod. How do I remove the songs from one playlist and leave them on the other playlist?

    I have the same songs showing up on 2 playlists on my Ipod. How do I remove the songs from one playlist and leave them on the other playlist?

    Hi tmilbut,
    Welcome to the Support Communities!
    The information below may be able to answer your questions about how to delete items from a playlist on an iPod.
    iPod Nano User Guide - Remove items from a playlist - page 23
    http://manuals.info.apple.com/MANUALS/1000/MA1624/en_US/ipod_nano_user_guide.pdf
    Remove items from a playlist:
    1 On the Home screen, tap Music > Playlists, then tap the playlist you want to edit.
    2 Flick down, then tap Edit.
    3 Tap next to the item you want to delete, then tap Delete when it appears on the right.
    4 When you finish, tap Done.
    Delete a playlist:
    1 On the Home screen, tap Music > Playlists.
    2 Flick down, then tap Edit.
    3 Tap next to the playlist you want to delete, then tap Delete when it appears next to the playlist.
    If you tapped the wrong playlist, tap the one you want to remove.
    4 Tap Delete, or tap Cancel if you change your mind.
    5 When you finish, flick up, then tap Done (or swipe right to return to the Home screen if you cancel).
    Cheers,
    - Judy

  • While trimming a clip in my timeline, the entire timeline moves with my trim. How can I stop that and leave a gap in-between clips?

    While trimming a clip in my timeline, the entire timeline moves with my trim. How can I stop that and leave a gap in-between clips? Also when I use my blade it only leaves a dotted line in the clip. How can I make that a solid line? I do a lot of flickering in my videos and don't need that some what of a snapping effect while I edit. Please help me someone. I believe i upgraded from FCP 10.0.1 to 10.0.3 and before it never did this.

    Mark an In point and an Out point (which creates a Range) and hit the forward delete key (Replace with Gap.) On a MacBook, you'll probably need to hold down the Fn key and type the Delete key (or, I think you might be able to use Shift-Delete as the same command). On an iMac/Mac Pro keyboard, it's the key just to the left of 'end' or the next key above the left arrow key.
    You can use the Range tool (hold down the R key and click drag over your clip) or the Blade tool to cut at the in and out (then select the cut and replace with gap).
    You can also go into Commands > Customize (command-option-K) and assign a different key to Replace with Gap.
    If you need to ripple edit the ends (cut), create a small section that is Gap, and hold down the T key while you use the mouse to click drag both ends (double sided trim cursor) of the cut.
    Don't worry about the dotted line blade... That just lets you know that the frames on either side of the cut are continuous, or sequential — nothing has been moved yet. Once frames from either side of the mark have been cut, it becomes a full fledged cut resembling a separate clip.

  • How can we calculate no.of leave used by the employee except sunday.

    Dear Friends,
    i have query how can we calculate no.of leave taken by the employee except sunday & government holiday.
    Example: A person take a sick leave From 13/02/2008 to 20/02/2008 with in that period 17th was sunday.
    when we calculate absence day for that person,Total value is 8 days but exact output is 7days only.How can i get exact result,any function module is avilable for this issue .
    Thanks & Regards,
    Rajkumar.A

    Hi,
    you have to consider SL leave as in holiday's So you can check with clinet if client says consider you can otherwise you con't
    its depend client requirement
    and you can go to controlls inSAP and change absence controlls for SL with holidays
    Regards
    Suresh

  • How to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi?

    I'd like to how to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi.
    Any help would be appreciated.

    NeoChang:
    You can modify the installation package using the Adobe Customization Wizard to toggle the "Display PDF in Browser" but I have not found a setting to disable JavaScript from the Wizard. I have created a script which makes the changes, but it has to be run for every user since that info is stored in the User hive of the Windows registry.
    Disable JavaScript:
    REG ADD "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs" /v bEnableJS /d 0 /t REG_DWORD /f
    Disable Browser Integration:
    REG ADD "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /v bBrowserIntegration /d 0 /t REG_DWORD /f
    Michael
    ~Simplicity of Character is a Natural Result of Profound Thought~

  • How to disable iMac screen and not to put it into sleep?!!!

    I would like to play a movie on my iMac but to watch it on my LCD TV. How to disable iMac screen and not to put it into sleep. PLS have in mind that ctrl+shift+ eject does not work, it makes my iMac screen go  black as well as the  tv screen.So far, i have red many articles concerning this subject, but no one seems to have the right answer. I simply can´t believe that apple did not think of it, as it is nothing new ....
    Thanks

    My brother has eight cats, so your not along. Fortunetly his go outside.
    I have been talking to the people over at macforums and they had some good thoughts. One guy suggested going analog and soldering in a rocker switch on the cable connecting a hub to the computer, turn off switch turns off keyboard and mouse.
    I was prepared to try that but a great idea came along. Arch, you might be interested in this too. Buy a cheap (found one locally for $20) usb kvm switch that takes one usb keyboard and mouse and connects it to two pcs/macs and only connect one of the outs to my system. There is a button to switch between the two, so when I want to disable the keyboard and mouse, I just switch it to pc2, which is not connected to anything.
    Cheap and easy solution. I wish I could of figured out how to do this with software, since there would be no money if it was freeware, but I guess you cant win them all.
    Thanks everyone for chiming in!

  • How can I access photos and videos saved to the iCloud?

    How can I access photos and videos saved to the iCloud? I backed up my iphone to the Cloud but now the files are nowhere to be found.
    I had to reset all content and settings in order to troubleshoot an issue. Before I did this, I backed up the iphone to icloud. When I reprogrammed the phone, I had to set it up as a new device and individually sync apps and other items from itunes. But by doing this, I somehow lost some videos and can't seem to find where they would have been saved/backed up. Can anyone offer any guidance?

    You can't view photos and videos on icloud (except for shared photo stream pics).  iCloud merely sync photos between devices using the stream.  If you don't have photo stream turned on, then the only place photos in the camera roll are located are in a backup.  You would have to restore from the backup.  But be warned that many users have ended up losing their photos when performing a restore, for whatever reason. 
    What you should do in the future is always sync photos/videos to a computer for storage, don't leave them on a device or trust icloud to somehow store them.

  • How to disable external VGA and also enable onboard VGA

    hello,
     my spec is
    cpu corei5 ivybridge
    mis zh77A GA43
    vga hd7770 msi
    i want to know, how to disable external VGA and also enable onboard VGA ??
    and
    i want to ask too, if i disable external VGA In MB, it is my external VGA still consumption power? or i must unplug my external VGA ?
    how much different power consumption between external VGA and onboard VGA on idle time?
    because my computer each night be used for download, i want to save power as i can...
    also there is a eco mode? i want to know about eco mode, how much power can be save under eco mode? on idle time computer
    sorry my bad english

    Well remove the HD7770 and is disabled and doesn't consume any power. You can't enable or disable it the discrete vga when pc is in use. That board does also not support Virtu.
    The possible power saving beacuse of eco mode depends on the individual systems. There is no general value. Just try it. 

  • I have 2 Macs - an iMac that holds my entire iPhoto library and a Mac Book Pro that I use to hold a subset of the main library - how can I transfer photos and their metadata from the main library of the iMac to my Mac Book?

    I have 2 Macs - an iMac which holds my main iPhoto library and a Mac Book Pro which holds a subset of the library. How can I transfer photos and their metadata from the main library to the smaller 1 on the Mac Book Pro?

    Link the two Macs together and use iPhoto Library Manager
    Regards
    TD

  • Upon syncing my iPhone and mac all of my ical and iPhone calendar events have duplicated. how can i fix this and avoid it in the future?

    upon syncing my iPhone and mac all of my ical and iPhone calendar events have duplicated. how can i fix this and avoid it in the future?

    Greetings,
    Questions:
    1. What version of the Mac OS are you running (Apple > About this Mac)?
    2. What version of the iOS are you running (Settings > About)?
    3. Do you backup your computer (http://support.apple.com/kb/HT1427)? 
    --- If you don't regularly backup your computer, now is the time to start.
    4. Do you backup your iPhone (http://support.apple.com/kb/ht1766)?
    Check the calendar list on the left hand side of iCal.  Is it that the individual events are duplicated or is it just that you have the same calendar listed more than once?  If its that you have more than 1 copy of each calendar, you can delete one of the duplicate calendars to eliminate the duplicates.
    If you find that it is the individual events that are duplicated then there are 2 options:
    1. Restore your computer iCal database or iPhone from a backup made before the duplication occurred.
    2. Use a duplication removal program (or do it by hand) to remove the duplicates: http://www.nhoj.co.uk/icaldupedeleter/
    If you have a backup made before the duplication occurred, reply back with what kind of backup you have and I'll suggest how to recover the calendars.
    To avoid this issue in the future:
    Keep regular backups.  They are your best defense against data anomalies which are a fact of life in computers (although hopefully rare).
    Keep your computer and iPhone software fully up to date (Apple > Software Update / Settings > General > Software Update).
    Make sure the date and time on your computer and iPhone are correct before you sync the two devices.
    Make sure the cable connections between the two is solid and that the cable shows no signs of physical damage.
    Hope that information helps.

  • When i send a text in iMessage the person receiving it gets it from my email address... how do i change that. and in message settings the receiving thing has my email and phone number but my phone number is gray and i can't click on it

    when i send a text in iMessage the person receiving it gets it from my email address... how do i change that. and in message settings the receiving thing has my email and phone number but my phone number is gray and i can't click on it help

    Hello Todd:
    I had this very same problem when trying to activate iMessage and Facetime on my iPad. When I signed into my account, I actually wasn't even presented with the option of a phone number - notwithstanding the fact that I was contacting others (and being reached by others) by my phone number on my iPhone. Having both the iPad and the iPhone on, I kept trying to turn off and on both iMessage and Facebook in Settings on both my iPad and iPhone, hoping that that they would eventually sync. But this proposed solution by others was unsuccessful for me.
    Then, I found out what the problem was: When my iPhone was activated, it automatically registered my phone number for contact purposes. I was using iMessage on my iPhone for quite some time without actually being signed into my Apple ID account. When another device - such as an iPad or iPod - is being used for iMessage or Facebook, you are prompted to sign into your Apple account, using your username and password. These two devices will not register your phone number as an option for contact unless your iPhone is signed into your Apple account as well. In other words: your phone number will not be synced.
    Go into your "Settings" on your iPhone and click on "Messages". Scroll down and click on "Send & Receive" (which should be followed by your phone number). On the next page, you will be able to determine whether or not your iPhone is using the Apple ID for messaging purposes. (Note: This information applies for Facetime as well.) If it is using your Apple ID for messaging, than at the top, you will see "Apple ID: <your particular e-mail account>" in Blue text. However, if you are not using your Apple ID for messaging, than you will see the words: "Use your Apple ID for message". Even though below this you will see your phone number checked as the contact source, you will want to click the tab that says, "Use your Apple ID for message". Sign into your account (just as you must sign in for iMessage on your other devices), and just choose your phone number as the "Send & Receive" contact. (The option of the e-mail will be there too, but you don't have to check it. And later on, you can delete it as an option.)
    Now that all of your devices are signed in using your Apple ID, the other devices should register your phone number as a choice. It may take a little while, however. What I did was sign out of iMessage on my iPad, and then sign in again. If the option didn't appear, I just went back and signed in again, and kept doing this until the option for the phone number appeared.
    Again, this will work for Facetime as well. The solution is to sync your iPhone account with the other devices by using your Apple ID for messaging (and Facetime) purposes.
    I hope that this works for you, Todd!   ~ Brian

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • How to show company name and contact name on the incoming calls of iPhone 4

    Kindly provide me with a useful solution of how to show company name and contact name on the incoming calls of iPhone4.
    even with an application or from the setting of the iPhone itself, but without telling me a solution like writting the company name in the contact name field.
    This is a very important option, i think it is a must, not an option and apple should fix this problem fastly. because it is already available in the older models of iPhone like iPhone 3G and 3GS.
    How an important feature like this could be available in old models, but in the later models is not available?

    Currently not possible without putting the company name in the contact name's field.  AFAIK, it's never been available on any iOS version.
    You might check the App Store for an app that can do this although I'm pretty sure you won't find one.
    http://www.apple.com/feedback/iphone.html

  • How to export an album and keep images in the same order in elements 11 mac

    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos

    Thanks for the tip, Michel
    It worked like a charm…
    cheers Jos
    Op 28 okt. 2013, om 18:49 heeft MichelBParis <[email protected]> het volgende geschreven:
    Re: How to export an album and keep images in the same order in elements 11 mac
    created by MichelBParis in Photoshop Elements - View the full discussion
    JosU a écrit:
    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos
    The order in album is only kept in the organizer database, so the only way not to lose that order is to rename files.
    If you are using the 'export' function, select your album in custom order, select all photos and in the dialog, choose to rename with a common base name.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5794538#5794538
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5794538#5794538
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5794538#5794538. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How do I take movies and save them on the iPad?

    How do I take movies and save them on the iPad?
    Thank you for your help.

    Tank you Jim for responding: "(swipe Video to the selected position - don't just touch it)."
    (I can't believe this!) I open camera. tap video: nothing. Swipe video button (where to?) nothing.
    Reading videos at a glance in the iPad user guide gives me nothing. I know I must be missing something. 
    Thank you for your help.
                                             Walter                                                                                       

Maybe you are looking for