I decided to create some of my own widgets for the SmartDashboard and have been only somewhat successfull. So far, I have taken the source code for the Dashboard and edited the code for the ProgressBar in a new project. As of now the bar works exactly the same except that it also displays the value superimposed over the bar. However, I’m using it for values that range from -1 to 1. Instead of having the bar half full when it is at 0 value, I want it empty at 0 value, full for 1 or -1 values, and in-between for corresponding values. I think I can get that done. BUT, I also want it to change color to indicate if the value is negative or positive(green for positive, red for negative) hoever I am unable to find a way to override the nimbus configuration and change to color at all. Everything I have tried so far has either caused the bar to disappear or not change at all. Please Help!
Instead of copying the SmartDashboard project, why not make an extension for it?
That way, you can give your compiled code to other teams in a standard manner.
I am, I’m just using a lot of the code that came with it and adding on to it.
I don’t seem to be getting many responses…Is what I’m asking not possible, or is it hard to understand? Just to clarify, I need to know how to change the color of the bar on a single JProgressBar that was created using Nimbus L&F.
I was actually hoping more people would post about creating widgets, because our team has no experience with this yet, and it would be nice to have some examples available.
That said, it doesn’t seem like your question is really related to smartdashboard. It’s more of a Nimbus/Java UI question… I’m not familiar with Nimbus… but does this google result help?: http://stackoverflow.com/questions/7174420/change-colors-for-jprogressbar-with-nimbus
I saw that and tried the first two lines
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
defaults.put(“nimbusOrange”,defaults.get(“nimbusBase”));
but it just made the bar disappear altogether.
I’m thinking what I really need is a painter, but I don’t know how to use them.