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

simgineer
  • 1,754
  • 2
  • 22
  • 49
  • *"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'. – Andrew Thompson Feb 10 '12 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 Feb 11 '12 at 05:36

1 Answers1

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.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045