3

For some reason when I disable the progress bar in swing it still looks the same. Is the appearance not supposed to change when the JProgressBar is disabled? the labels definitely change in appearance. Could this be because i'm using the windows xp look and feel? Or is there another way to achieve this?

UPDATE

So here is my quick test on windows 7. Default appears to be Nimbus where disabling the progress bar will fade it out. However when I used the PLAF there is no affect to disabling the progress bar.

Nimbus LAF with top progress disabled Microsoft LAF with top progress disabled

2
  • "Could this be because i'm using the windows xp look and feel?" Could be. Why not try changing the PLAF and report back? BTW - I'm not sure it makes much sense for a progress bar to be 'disabled'. Commented Feb 10, 2012 at 17:36
  • Well if you can disable a label then i figured it wouldn't hurt to disable the progress bar as well. I updated the question per your suggestion :)
    – simgineer
    Commented Feb 11, 2012 at 5:36

1 Answer 1

5

The disabled appearance is controlled by the UI delegate for a given Look & Feel. For example, the Mac's com.apple.laf.AquaProgressBar turns from blue to gray when disabled. You can implement your own delegate as shown here, but you'll have to decide if it's worth the effort.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.