Setting the color of a disabled checkbox...

Hi,
how do I set the color of a (disabled) JCheckBox because the following code does not work for me:
jCheckBox1.setForeground(Color.BLACK);The background is that I don't want to have the checkbox in this grey (disabled) style, instead it should look like a "normal" checkbox (but disabled).
Any ideas?
Best regards
- Stephan

WindowsLookAndFeel uses native APIs to draw most of the controls. So, a disabled checkbox under Windows LAF will use the same API as the native disabled checkbox. You can install a custom JXLayer on that checkbox to prevent all the events from being passed to it - not the cleanest solution, but it will get you there (and make your users annoyed that they can't click on that checkbox).

Similar Messages

  • Dynamically setting the color of the title in a Panel

    Hello, I know I can set the color & font of the title in a Panel using the titleStyleName in a stylesheet.  How can I dynamically change the color though?  I have a component:
             <mx:Panel id="myPanel"borderColor="{this.color1}" />
    where this.color1 is a value that changes dynamically, and thus changes the border color.  How do I do this for the color of the text in the title?

    Hi,
    Try this
    var css:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myPanelTitle");
    css.setStyle("color",0x00FF00);

  • How to set the color to the particular row in a report

    Hi
    I have a report in which I have an edit link(I changed the id as edit link)..When I click that link, all the details(the whole row details) will be appearing on the items nearer to the report to save the changes....
    I want to set the color for the particular row when a link is clicked and the color should not be changed until I save the changes in items...After saving the changes, the report should come in the normal color...this is my requirement..i refered many forums regarding this...But could not find solution....If anyone knows,please help me...
    Fazila

    Here is how I would implement
    Create renderer
    Add SkinnableContainer element and create a skin for this container namely SkinnableContainerSkin
    find the fill section in the skin
    add bitmap fill to the fill section and give the source of the image which you are planning to use(Hopefully this is a direct way of doing, may be you need to hack this a little to get it to work)
    I've never tried this, but should help you give some idea.

  • How to set the color scale so that we can get same color for same intensity of color in various runs

    Hi
    I am trying to get the color pattern of mashed potato trays and diferent trays has different color intensity but if IF i am chsooing rainbow plateu it's giveing red color for dark region of each tray but two tray has different intensity of dark color. Can you suugest me how should I set the color scale so that I can distinguish which tray has higher degree of intensity of darkness.
    I will be obliged to get the suggestions

    Hello,
    Thank you for contacting National Instruments. I just have a few questions for you to help us clarify your application:
    What API, such as LabVIEW or C, are you programming your application in?
    Are you using Vision, and if so what specific functions are you currently using?
    Is the lighting consistent and just the color of the trays changing?
    How are you displaying the image in your program? Are you using an Image Display control?/li>
    Depending on what functions you have available, then we may be able to work on finding a way to distinguish between the different intensities. If you could provide a little information to your application based on these questions then will be able to better understand and help you with your app
    lication.
    Regards,
    Michael
    Applications Engineer
    National Instruments

  • Link Color not changing for Visited Pages - How do I set the Color?

    In earlier versions of Safari, the user could select the color used to display links that have already been visited. I can't find that option in Preferences anymore. Some visited links do show a different color, some don't. Is it just random? How do I set the color in Safari 4.0.4 and activate the behavior?

    HI,
    I think you change visited pages link colors using Google preferences.
    http://www.googleguide.com/preferences.html
    Carolyn

  • Setting the color (or background color) of a substring

    Is it possible to set the color of a substring. For example:  If I had the string "Steve is stuck and needs help" and I wanted to change it to become "Steve is stuck and needs help".
    At present I am trying to modify the text inside of a String Indicator, but am open to suggestions.
    I have been reading the LV help and it seems to suggest that you can do this using the Text.SelStart and Text.SelEnd properties, but I can't get over that last hurdle that actually updates the string.
    Regards
    Steve
    https://decibel.ni.com/content/blogs/DailyCLAD
    Solved!
    Go to Solution.

    So close.
    Thanks All
    https://decibel.ni.com/content/blogs/DailyCLAD

  • Can you set the color of a specific element in a JList?

    Is it possible to set the color of a single element in a JList without writing lines and lines of your own class? I know setForgroundColor exists, it just changes all element in a JList, so is there a simple way to tweak it? i am still a newbie, so re-writing swing, would be a bit of a problem for me. Any Suggestions? thanks.

    you write your own renderer, about 6-8 lines, setting the color determined by an
    if/else statement - note: you must set the color in both if and else
    search the forums for
    "implements ListCellRenderer"
    and you should find plenty of examples
    if you just want the selected element a different color, you can do this with
    UIManager.put("List.selectionBackground", new javax.swing.plaf.ColorUIResource(Color.YELLOW));
    but you must do this before you create the JList, and it will affect all JLists in your program.

  • Can u tell me how to set the color of the button and its border

    hi to all,can u tell me how to set the color of the button and its border

    There are sample code on the java.sun.com
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/index.html
    try this web page ... There are lots of examples... Good luck ... "Gan en "

  • Setting the color on selected Tab

    Hi,
    I can't seem to figure out how to set the color on the
    selected tab in a JTabbedPane. I've added a
    ChangeListener but when I try to use it, it only
    changes the color after the tab has been selected.
    I want to change it while it is selected.
    How can I do this?

    Maybe this helps:
    http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
    Kurta

  • Setting the color of 3D EM Structures

    i have no issues setting the color i like for the 2D layer drawings. 
    and they are also correct on the 3D of the schematic layout
    however my problem is in setting the color in 3D layer for EM structures. They seem to be different.
    I tried setting the color of my material definitions (topmetal) under the material definitions tab of the STACKUP.
    but the color does not correctly translate in the 3D EM structure.
    please advise.

    i got it correctly setting the color of the 2D and 3D for EM structures by following your suggestion in setting the COLOR KEY. that's new to me. thanks
    but my major problem is still unsolved where the color settings of my 2D/3D schematic layouts is different from 2D/3D EM structure layout. I always set the color in the LPF file. for my case for example, my topmetal is defined in lpf as RED. but then when i draw shapes in 2D EM structure, the color for this topmetal layer becomes BLUE...quite lost on this because there's only 1 way to set the color in LPF under "General, Drawing layer 2d"...

  • Setting the color of the window title in Forms 6i

    How does one control or set the color of the title of the MDI and module windows
    gordon
    [email protected]

    Gordon, I'm pretty sure this is actually outside the realms of Forms since the Window Manager is controlled by the O/S and so the only way you can set this is via the PC desktop (there is nothing exposed in Set_Window_Property that can do this).
    Hope this helps.
    Regards
    Grant Ronald
    Forms Product Management

  • Setting the color of individual pixels in a bufferedimage

    i am trying to set the color of each pixel in a loop as follows:-
    BufferedImage bi=new BufferedImage(w,h,BufferedImage.TYPE-INT_RGB);
    for(int j=0;j<h;j++){
    for(int i=0;i<w;i++){
    pixel=translate(i,j);
    clr=findcolor(pixel);
    if(clr==-1){
    bi.setRGB(i,j,0);
    else
    bi.setRGB(i,j,clr);
    findcolor() function just returns an int, so how do take this integer value and set the appropriate color?
    when i execute this code,in the PaintComponent method of a JPanel class, my entire panel becomes black, this is not because of my first "if" condition.i checked the return value of my findcolor function.
    However if i multiply the color value by a large number like 10000, then i get a few colors only(black,blue, green)
    So please let me know how i can get all colors, without having to multiply the value.

    What do the translate and findcolor methods do?

  • How can I set the color for a textfield

    Hi all,
    I use a textfield and I want to set the color for characters which are typed in the textfield. I didn't find anywhere a solution for this. Do you know how I should implement this?
    Thanks

    Not possible. If you want this, you'll need to make a custonItem that implements this.

  • I have set the CustWiz/MST to 'Disable and Lock' the ability to display PDFs in the browser.  We wan

    I have set the CustWiz/MST to  'Disable and Lock' the ability to display PDFs in the browser.  We want  them to open separately in Acrobat.  After I deploy, the setting IS  disabled and locked, but when you click a PDF in the browser, it STILL  opens in the browser, and not in Acrobat.
    I am pushing  Acrobat onto machines that already have Acrobat Standard 9 installed  with the same settings.  It worked properly then.
    What is causing this setting to be ignored?  How can I fix it?  It's delaying my deployment.
    I have to deploy Acrobat 9 due to the bug I discovered here:
    http://forums.adobe.com/thread/865843
    (With many other frustrating responses).
    This is getting a little irritating...
    Thanks for any input!
    Acrobat Standard X
    XP SP3
    Firefox 5

    Thank you for the answer about updating the Foxit plugin. Firefox tags the Foxit plugin as potentially unstable, so it turns out I had another program killing the plugin's startup process so it was always disabled in firefox. I reenabled its startup process and updated the plugin. To get firefox to use it as the main pdf reader I went to options>applications and changed the option for pdf to the foxit plugin and everything works dandy now! Thanks again!

  • How to set the color of ticks in JSlider

    Hi,
    Question about JSlider.
    I am trying to set various colors between the ticks. However, I have gone thro' the javadoc of JSlider but find no such API.
    How could I go this?
    Thanks in advance for any inputs and ideas.
    Wing

    Here is quick demo about customize thumb.
    It is similar for customize other part of JSlider.
    You can use setUI to force use your own UI.
    Create your UI, the better way is extend from existing UI,
    for example: BasicSliderUI or MetalSliderUI (or... depend on L&F you want).
    Check the BasicSliderUI and MetalSliderUI API
    customize the paintXXXX method, that's it.
    Good Luck.
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.plaf.metal.MetalSliderUI;
    public class Test {
      public static void main(String[] args) {
        JFrame f = new JFrame();
        JSlider slider = new JSlider();
        slider.setPaintTicks(false);
        slider.setUI ( new MetalSliderUI() {
          public void paintThumb(Graphics g)  {
              Rectangle knobBounds = thumbRect;
              Color color = g.getColor();
              g.setColor(Color.red);
              g.fillOval(knobBounds.x, knobBounds.y, 15,15);
              g.setColor(color);
        f.getContentPane().add (slider);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.pack();
        f.setVisible(true);
    }

Maybe you are looking for