JSlider Enabled Coloring

I have a JSlider and I am trying to write an extended UI which does not make the slider labels turn Gray when I call slider.setEnabled(false); (Note that when a JSlider is disabled, the labels and tick marks turn gray)
In particular, I want the JSlider labels to stay BLACK regardless of if the slider is enabled or not. I overrode the BasicSliderUI class and added this method:
protected void paintHorizontalLabel(Graphics g,int value,Component label)
      JLabel lbl = (JLabel)label;
      lbl.setForeground(Color.BLACK);
      super.paintHorizontalLabel(g,value,lbl);
    }However if my JSlider is not enabled, the labels turn gray no matter what. If the slider is enabled, this technique works and the labels become black.
Can anyone give me an idea how to make a JSlider whereby the color does not change regardless of if the slider is enabled or disabled.

see example:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import javax.swing.*;
public class EnableTest extends JSlider {
    private boolean enabled = true;
    private MouseListener[] ml;
    public void createGui() {
        JCheckBox enableCB = new JCheckBox("enabled");
        enableCB.setSelected(true);
        enableCB.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                getSlider().setEnabled(((JCheckBox) e.getSource()).isSelected());
        JPanel pane = new JPanel(new BorderLayout());
        pane.add(this, BorderLayout.CENTER);
        pane.add(enableCB, BorderLayout.NORTH);
        JFrame frame = new JFrame("Example");
        frame.add(pane);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    @Override
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
        if (enabled) {
            for (int i = 0; i < this.ml.length; i++) {
                this.addMouseListener(ml);
} else {
ml = this.getMouseListeners();
for (int i = 0; i < this.getMouseListeners().length; i++) {
this.removeMouseListener(ml[i]);
@Override
public boolean isEnabled() {
return enabled;
public JSlider getSlider() {
return this;
public static void main(String[] args) {
new EnableTest().createGui();

Similar Messages

  • How to Enable Color Management? (DV Compression Is Lightening Gamma)

    This problem has plagued me with both After Effects and Premiere. I have a project with a number of .mpeg video files (I know MPEG is a bad file choice, but it's not causing the problem--I tested this with uncompressed media also). In AE, I have a darkly lit scene with gamma turned down to produce pure blacks in the shadowy areas. When I render as DV, Windows Media, or QuickTime and play the resulting file in Windows Media Player or Media Player Classic, the file has rather ugly dark grays where pure blacks should be. I read the article on color management and thought I had found the problem, but the "Use Display Color Management" option is grayed out and I've been unable to re-enable it.
    Also, I don't know if this is of any major value, but the DV and Windows Media file versions look the same in Windows Media Player as they do in Media Player Classic. QuickTime files look slightly better in Classic than in the default QT player. This issue is especially confusing since the article only acknowledged that this can happen with QuickTime, whereas I'm having this problem with all formats except uncompressed. Thanks!

    > How do I enable display color management?
    Have you enabled color management for the project (i.e., selected a working color space for the project)? If not, please read
    "Choose a working color space and enable color management" for an explanation of how to enable color management for a project.
    "Enable or disable display color management" contains information on managing colors using your monitor's color profile.
    You said that you read "the article on color management", by which I presume that you mean the "Color Management Workflow" white paper on the Adobe Design Center website. That paper links to the
    "Color management" section of After Effects CS3 Help on the Web and presumes that you'll consult that document for some of the basic underlying concepts and detailed procedures.
    > And I guess it's a redundant question, but are the answers to this issue the same for Premiere as for AE?
    Premiere Pro does not do color management.

  • Tabbed Pane Enabling Color

    How Can I change TAbbed PAne Enabling Color ???
    Default color is gray and it's not very nice ...
    Thanks!

    Here it is with your line added. If this doesn't adequately demonstrate your requirements (the disabled tab color is orange), you're going to have to be a little more descriptive.
    import javax.swing.*;
    import java.awt.*;
    class JTabbedPaneDemo extends JFrame {
        public static void main(String[] args) {
            new JTabbedPaneDemo().go();
        void go() {
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(300, 150);
            UIManager.put("TabbedPane.selected", Color.GREEN);
            JPanel panel1 = new JPanel();
            panel1.setBackground(Color.BLUE);
            panel1.add(new JLabel("Foo"));
            JPanel panel2 = new JPanel();
            panel2.setBackground(Color.MAGENTA);
            panel2.add(new JLabel("Bar"));
            JTabbedPane tabs = new JTabbedPane();
            tabs.addTab("Tab 1", panel1);
            tabs.addTab("Tab 2", panel2);
            tabs.setForegroundAt(0, Color.BLACK);
            tabs.setBackgroundAt(0, Color.GREEN);
            tabs.setForegroundAt(1, Color.RED);
            tabs.setBackgroundAt(1, Color.ORANGE);
            tabs.setEnabledAt(1, false); // Here you go, lazybones.
            getContentPane().add(tabs);
            getContentPane().setBackground(Color.YELLOW);
            setVisible(true);
    }

  • How to enable color printing setting in R/3

    Hi,
    We have configured HP COLOR Laster jet 2650DN printer at r/3 level. but users are not getting print in color, when they give non sap print, then it prints in colors. I tried to enabled the color printer option in spad -> output attribute, but it didnot help. Is ther any other setting can enabled the color printing in sap ?
    Thanks
    Rajesh Kokane

    I understand that the issue is with color printing only for this printer. What device type are you using? Only printers listed in this note are fully tested and supported by SAP as detailed.
    Does color printing work for other printers you have and are the SPAD settings the same?
    Regards, Mark

  • How to enable COLOR EFFECT, DISPLAY, etc. panels for the custom components?

    POSITION AND SIZE and COMPONENT PARMETERS are the only panels available for the custom components. Is there a way to configure the custom components or the Flash Pro itself to enable other panels (COLOR EFFECT, DISPLAY, etc.) that available for the Adobe UI components?

    In Flash CS6, you'll need to place your component(compiled clips) inside a Movieclip symbol to apply these settings. In Flash CC, you may do so directly from the Properties panel like for any other movieclip symbol.
    Let me know if you face issues.
    -Nipun

  • Suite Color Management is not enabled in PS CS5.

    Hi everybody,
    Here I am getting a problem that Suite Color Management is not enabled in PS CS5, I want to give you the details of my operating System: My OS contains XP-SP2, and my system is having very less RAM too and here my Photoshop Application is not a full suite.Is it compulsory that Photoshop should have complete suite. So my question is how to enable Color management in Bridge. And I am a home learner.So please help me out from this issue.If you want any more details please send mail.Then Surely I will give

    You asked this yesterday and received a full answer. I'm not going to type it again.
    https://forums.adobe.com/thread/1494939

  • How to fill JSlider bar with different color

    I got an problem actually i am in learning state.
    I used Look and feel for windows. UImanager changes the lookandfeel
    But in jslider filled color is blank. how can i change the color&jslider knob is perpendicular to jslider bar how can i fit the knob in jslider bar.pls give suggestions

    Try to use this in you paint method :
    public void paint(Graphics g)
    Graphics2D g2D = (Graphics2D) g;
    // Get the height & width
    int width = this.getWidth();
    int height = this.getHeight();
    // Create the gradient paint
    gradientPaint = new GradientPaint(0,0, Color.blue, width, height, Color.red);
    g2D.setPaint(gradientPaint);
    g2D.fillRect(0,0, width, height);

  • Colored Calendars on iPhone--And how they don't work.

    Ok. Let me start by asking Steve and Apple, "***?!"
    I use colored calendars. They help [me]. I can visually look at my week view and determine how much of my week consists of work, and how much consists of play. Oh, and look, there's my silver calendar, it's someone's birthday on Saturday. And there's a red box, so that means my team is playing on Sunday. Colored calendars are great...but why don't they work properly for the iPhone when they sync??? This is the most ******** thing I've ever seen.
    My Blue (Personal) calendar is Orange on my iPhone. My Green (Work) calendar is Purple on my iPhone. Oh and guess what? My Holidays, Birthdays, and other calendars are other colors too. Do you know why my personal calendar isn't orange on my iCal? Because I hate the color orange. I made it blue for a reason.
    Why would they enable colored calendars without a) just making them sync to what the calendars are on iCal, and b) not giving you the option to edit the colors. I mean, if they're not going to just make it a proper sync, the least they could do is allow me to adjust the colors, right?
    This is just one more thing that the developer of the 2.x software didn't think of.

    An Apple kbase article 'explains' this (really, I would call it more of an excuse than an explanation!).
    Each calendar is assigned a different color to allow you to easily identify which appointments belong to which calendar and _this may not match the exact color used on the computer_.
    In the meantime, there is a workaround, although it is something of a pain. The iPhone will apply calendar colors in the following order: red, orange, blue, green, purple. (If you only sync one calendar, it's blue).
    Depending on the colors you want, you first need to create 'blank' calendars in iCal to 'use up' unwanted colors. Then, you need to sync the calendars, one at a time, in color order.
    Go to the Info tab (in iTunes with the iPhone connected and selected in the devices list). With the Sync iCal calendars box checked, UNcheck all the boxes and sync. Then, check the box for the calendar you want to be red. Then sync (if you look on the iPhone at this point, that calender will be blue, since it's the only one). Then, check the box for the calendar you want to be orange, then sync. Repeat for blue, then green, then purple.
    For example, if I want to have two calendars, Home colored blue and Work purple, I would create three new calendars - empty1, empty2, empty3 - then check the boxes in the following order, syncing between each: empty1, empty2, Home, empty3, Work.
    Also, you can submit feedback to Apple: http://www.apple.com/feedback/iphone.html.

  • Color Management in Adobe Flash Player

    Is there any way to enable color management in Adobe Flash Player? I want to see color-managed-video on some sites that use Flash Player (like YouTube). I've looking for the solution anywhere, but happened not to found one. Any help would be appreciated.

    It looks like this is driven by the content and might be browser dependent - http://www.adobe.com/devnet/flash/quickstart/color_correction_as3.html
    However, I'd try disabling hardware acceleration to see if that makes a difference.  I wouldn't be surprised if using the GPU altered the way this works.
    How do I disable or enable hardware acceleration?

  • CS3 color management won't match prints

    Okay, I know there are a lot of boneheds who can't figure out how to set up color in Bridge and CS3 but I am at my wits end on this so bear me out.
    Windows XP and CS3
    Bridge is set to; Enable color management in Bridge
    RAW conversion is SRGB
    CS3 color settings/working space set to SRGB
    Print color management is set to SRGB and Photoshop manages colors
    Printer is set to "application manages colors" (HP B9180)(btw, I have also tried it set to SRGB)
    Image looks the same on Bridge, RAW conversion, CS3 and print screen (dark)Image looks LIGHTER when viewed with any other program (including windows picture and fax viewer, HP print program, Paint Shop Pro and online) and prints to match the lighter image both on my HP and from my lab!
    The closest I have been able to get to a total sync is to set Photoshop's color settings to "Monitor color," and uncheck the box in Bridge that says "apply color management settings in Bridge." In that case, Bridge and CS3 produce a lighter image but RAW conversion is still darker. Plus, who the hell wants to use monitor color in Photoshop!?

    That's pretty much it David... I could get Photoshop to match my prints but then any other program would show the prints as being waaaay off-color.
    Today I bought a spider2express and color balanced my monitor. Now everything seems to look in sync and my prints match very close (a little warm for my tastes..). Tech support at Photoshop told me it was a calibration issue but I thought that was bull... i mean, how can calibration make an image that looks different in two different programs look the same? Well, it does. As far as I understand it now (layman's terms)when you look at an image in windows viewer ot explorer or any other non-color management program you are looking at the image based on your monitor profile. When you look at the same image in photoshop the program uses it's own color management which then gets filtered through your monitor program to your eyes (but not to the printer). If your monitor profile is bad, the image looks bad.
    Or something like that :)

  • How to change the endeca studio chart color . version is 3.1

    how to change the endeca studio chart color

    See Configuring the color palette for the chart display and Enabling color pinning for the chart dimension values .

  • No color management in Photoshop plugin!?

    Today, I finally started playing with PixelBender in order to make some Photoshop filters for color and tonal corrections. Unfortunately, I seem to have hit a snag. Unlike any of the other filters, the preview window of the PixelBender plugin is not color managed. This means you're essentially flying in the dark when making adjustments. Not a big problem for a mosaic or warping filter, but it's pretty fatal for color adjustment filters.
    This probably has something to do with the fact that PixelBender uses its own display path (GPU/CPU). Then again, Photoshop itself also uses some 3D acceleration without breaking color management, so why can't the PB plugin do the same? Does anyone know if there is a way to enable color management? If not, is there any chance that this will be improved in the plug-in? Just in case this could depend on configuration: I'm testing this on a Windows XP SP3 laptop with integrated intel graphics (so I get CPU mode), running Photoshop CS4.
    As it stands, PixelBender has a lot of potential as a cross-platform plug-in platform for Photoshop, but it still has a few major drawbacks:
    The plugin preview window is not color managed.
    The plugin processes all pixels, regardless of zoom level and visible image area. This makes it slower than necessary.
    There is no way to determine the color space of the input image [or a way to use a standard space such as ProPhotoRGB/RIMM]. Without this facility, a 'color-aware' plugin must be written to match a particular color space.
    No access to UI controls beyond sliders.
    If only the new actionscript wrapper for Photoshop gave access to the image data, then most of the above could be addressed. For now I'll wait and see what, if anything, is around the corner...
    Regards,
    Simon

    Thank you for your response. It's good to know that a color-managed plugin could be in the cards. This would really be useful to me. Among other things, I'd like to port this plugin to PixelBender: http://21stcenturyshoebox.com/tools/tonability.html . It's currently written in C/C++, but programming for the combined Photoshop and win32 SDKs is such a pain that I'd prefer to move on sooner rather than later. Not to mention that a single PixelBender kernel could run on win/mac and 32/64-bit.
    I realize that getting access to the color space of the image would require a language change. Furthermore, it would probably require a library (supplied or self-made) to make sense of all possible color spaces, or to transform images to and from standard color spaces. A simpler possibility would be to add a checkbox in the plugin (or a simple kernel option) that imposes a particular reference color space on all inputs and outputs. The plugin container would then take care of transforming the image to the proper space and back again. My personal favorite for such a space would be the linearized ProPhoto space used by Lightroom and ACR, because it's linear and sufficiently large. And if I may dream a little: this choice would also make it easier to insert PixelBender filters into the Lightroom workflow at some point in the future...
    About the UI: a particular limitation I am running into is that I cannot control/restrict the sliders based on the values of other sliders. In my case, some inputs should always be higher than other inputs (and using relative numbers is not an option for the UI). The evaluateDependents() function is great for making sure that the kernel gets the right numbers, but there is no way to feed this information back to the user. For example, you cannot disable a slider, restrict its range or change its position from within the kernel. This is no surprise, given the one-way programming paradigm that the GPU is so good at, but a hindrance for writing 'stand-alone' plug-ins. Rather than changing the language to accomodate these features, would it be possible to have a flex/AIR container in the control section of the plugin? The Flex/AIR program could handle the UI, including feedback and other advanced functions, and could feed the PixelBender kernel with the correct parameters. Just another far-fetched suggestion, but it would make my life a lot easier.
    Simon

  • EPrint pics in B/W & grey tones not in color, What settings must I change?

    1. HpPhotoSmart 7510;
    2. Windows 7 64-bit;
    3. ePrint pics in B/W not color;
    4. no
    When color pics are sent to printer email, pics printed in Black & White not color.  What settings need changing to enable color printing.  Pages sent from computer to printer have color.   

    You say pages instead of photos in the last line of your post. So are these pictures embedded in the document?  Or, are you sending photos and they are printing from the photo tray in black and white instead of color?  Photos should automatically print in color.  Now, If there are pictures embedded in they body or another document, there is a setting at eprintcenter.com that needs to be checked.
    Once you have logged into your account at ePrint Center, go the gray button labeled "ePrint settings" and click on in it. Then go to the tap labeled Print options, then look at the section labeled "Color Mode" and see if greyscale is selected. If it is change that option back to color and then click  on save, then reattempt to print the ePrint. 
    I am a former employee of HP...
    How do I give Kudos?| How do I mark a post as Solved?

  • Flash Player (Web Export) showing wrong colors

    Cheers!
    Sometimes when I look at my exported galeries I'm not satisfied regarding the colors. Up to today I thought that this is based on my week skills in developing photos.
    But that seems to be wrong! Please helpt me with the following:
    I'm exporting via Web Module using a simple viewer template (which uses the adobe flash player to display images). Now I fire up that little web page in my browser (safari or firefox in my case) and compare what I see with what I see in lightroom (library module). I can notice a very severe difference in the color presentation. Next I start a second browser window and place it beside the one showing the flash player galery exported before. Within that browser window I call the image from the image folder within the exported web page and compare both. Hence! It does not look like the same.
    To illustrate that I shot the following a couple of minutes ago:
    http://minolta.karlos.at/test.png
    On the left you see the lightroom web galery (simple viewer) and on the right the jpeg picture itself. (You can try that by starting the web galery and then click on the photo and launch it with the command "open picture in new window"
    Weird!
    Is that behaviour known and is there any solution to avoid this wrong color display?
    Thanks!
    C.

    Flash is not color managed (although in the latest version you can somehow turn it on I understand) so it will never show the right color ever. That said, if you have a good display but not so good it has a wide gamut, and you calibrate correctly at gamma 2.2, you should see very similar color. The problem on Macs that have not been calibrated is that the default gamma is wrong (even Apple says this) and they have to be calibrated to be right. Normally Safari color manages so the gamma of most images gets automaticaly corrected, but it cannot color manage flash.
    That said, from your screenshot it appears the difference is entirely due to the difference in gamut between your display and sRGB. There is nothing you can do about it but pester Adobe to enable color management for the latest flash versions in the Lightroom flash galleries. Of course nobody that looks at your gallery will actually see the right color anyway as basically nobody calibrates their screen and most people do not even use color managed browsers.

  • Correct export color space for wide gamut monitors.

    Running a photography studio I have 4 typical scenarios of how clients or end users will see my photo work.  I create and edit the photos using LR 3 on a HP 2475w (wide gamut) monitor.  I'm aware that there are color shifts, but trying to figure out which export color space to use to be most consistent.
    A) Wide Gamut monitor using color managed software or browser such as Firefox.
    B) Wide Gamut monitor NOT using color managed software such as IE 8.
    C) Standard monitor using color managed software or browser such as Firefox.
    D) Standard monitor NOT using color managed software such as IE 8.
    A) gives the best results and that's what I run myself.  No matter the color space that I export (sRGB, aRGB, or my custom calibrated ICC) the images appear to be correct 100%
    B) gives mixed results...the hosting site for my photos seems to oversaturate a bit when I view the photos in their preview size which is what my clients see, when I view the original photo in full resolution (this feature disabled for my clients to avoid them downloading full rez copies of images), then the images appears a bit dull (70%).  When I try this same scenario using aRGB export, it looks better (90-95%).  When I export it using my monitor profile then the photo is spot on 100% however my monitor profile shows the photo incorrectly when viewing it using the standard Windows Vista photo viewer, it appears lighter and less saturated which I guess I expect since it's not color managed.
    C) On a standard monitor the photos all look the same regardless of color space export so long as I use a color managed browser such as Firefox.
    D) This gives pretty much the same breakdown of results as scenario B above.  At the moment, it appears that when I use my custom ICC profile which is the calibration of my monitor...I get the best web results.
    However my custom ICC profile gives me the worst local results within my windows viewer and when my clients load the photos on their machines, no doubt they will look just as bad on theirs regardless of which monitor they use.  So aRGB seems to be the best choice for output.  Anyone else do this?  It's significantly better when viewing in IE on both Wide Gamut and Standard LCD's when compared to sRGB.
    I would guess that my typical client has a laptop with Windows and they will both view the photos locally and upload them on the web, so it needs to look as close to what it looks like when I'm processing it in LR and Photoshop as possible.  I know that a lot of people ask questions about their photos being off because they don't understand that there's a shift between WG and non-WG monitors, but I get that there's a difference...question is which color space export has worked best for others.

    I am saying that since images on the internet are with extremely few
    exceptions targeted towards sRGB. It is extremely common for those images to
    not contain ICC profiles even if they really are sRGB. If they do not
    contain ICC profiles in the default mode in Firefox, Firefox (as well as
    Safari btw, another color managed browser), will not convert to the monitor
    profile but will send the image straight to the monitor. This means that on
    a wide gamut display, the colors will look oversaturated. You've no doubt
    seen this on your display, but perhaps you've gotten used to it. If you
    enable the "1" color management mode, Firefox will translate every image to
    the monitor profile. This will make the colors on your display more
    realistic and more predictable (since your monitor's very specific
    properties no longer interfere and the image's colors are displayed as they
    really are) for many sites including many photographic ones. This is most
    important on a wide gamut display and not that big of a deal on a standard
    monitor, which usually is closer to sRGB.
    It seems you are suggesting that for a wide-gamut display it is better to
    try using your own monitor's calibration profile on everything out there,
    assuming on images posted with a wider gamat it will get you more color
    range while there would be nothing lost for images posted in sRGB.
    Indeed. The point of color management is to make the specific
    characteristics of your monitor not a factor anymore and to make sure that
    you see the correct color as described in the working space (almost always
    sRGB on the web). This only breaks down when the color to be displayed is
    outside of the monitor's gamut. In that case the color will typically get
    clipped to the monitor's gamut. The other way around, if your original is in
    sRGB and your monitor is closer to adobeRGB, the file's color space is
    limiting. For your monitor, you want to make the system (Firefox in this
    case) assume that untagged files are in sRGB as that is what the entire
    world works in and translate those to the monitor profile. When you
    encounter adobeRGB or wider files (extremely rare but does happen), it will
    do the right thing and translate from that color space to the monitor
    profile.
    Wide gamut displays are great but you have to know what you are doing. For
    almost everybody, even photographers a standard gamut monitor is often a
    better choice. One thing is that you should not use unmanaged browsers on
    wide gamut displays as your colors will be completely out of whack even on
    calibrated monitors. This limits you to Firefox and Safari. Firefox has the
    secret option to enable color management for every image. Safari doesn't
    have this. There is one remaining problem, which is flash content on
    websites. Flash does not color manage by default and a lot of flash content
    will look very garish on your wide gamut display. This includes a lot of
    photographer's websites.

Maybe you are looking for

  • Error while downloading attachments more than 10MB

    Hi, We are getting the below error when downloading the attachments of size > 10mb. Client details: Java version: 1.6.0_05 OS: SunOS OS version: 5.10 OS architecture: sparc java.lang.OutOfMemoryError: Java heap space      at java.util.Arrays.copyOf(A

  • X isn't working anymore since the last system update.

    Hi there, I'm using Arch for a couple of months and didn't need a forums login until now. But currently I've broken somehow my system and can't get it working anymore. So I need some help of you. The Problem: Arch Linux is running on my computer at w

  • MacBook using BootCamp - Windows XP Bootup shows display in Portrait Mode

    I loaded Windows XP on my MacBook using Bootcamp. Everything was working fine, but now for some reason the display is in Portrait Mode when in XP. Does anyone know how to get the screen back to a normal mode?

  • Why won't itunes let me purchase new songs?

    when i try to purchase new songs on itunes it keep sending me an error message to go to www.apple.com/support/itunes/ww/ to see what wrong.

  • After UD stock is in Quality stock

    Hi All,    I am getting a problem with the Inspection lot, After doing UD for the inspection lot , System status is showing   UD   ICCO SPCO STUP HUM means stock posting is completed but actually the stock is not moving from quality stock to Unrestri