My app needs to display a graphical representation of a value ranging from -1 to 1. Negative values should be in one color, with positive values in another. Zero is in the center and shows nothing. (If it helps, the particular use here is to display the relative weight of buy and sell orders in a financial application.)
I would ideally like to use a pair of JProgressBars for this, however the Swing control starts (at its minimum) at the left. The standard control only supports two orientations, left-right or bottom-top. Passing in negative values doesn't help. My question is, what is the quickest way to achieve this effect?
Subclassing JProgressBar would involve re-implementing it almost entirely. Using a JFreeChart bar chart seems like a great deal of code (and effort) for a relatively trivial task. I could perhaps make a small, square-celled JTable and fill it in, but again that's a lot of code. What would you suggest?
Many thanks,
Tim