I'm trying to put a 1px border around a GaugeField to make it stand out. I'm using the code below, but it isn't having any effect.
SetBorder is in the api of GaugeField,开发者_运维知识库 but I'm not doing something right. Ideas?
progressBar = new GaugeField(null,0,100,0,GaugeField.PERCENT);
progressBar.setBorder(BorderFactory.createSimpleBorder(
new XYEdges(1,1,1,1),
new XYEdges(0,0,0,0),
Border.STYLE_FILLED));
It will have affect if you change from Border.STYLE_FILLED
to Border.STYLE_SOLID
.
The doc for BorderFactory.createSimpleBorder(XYEdges edges, XYEdges colors, int style)
says:
style - STYLE_TRANSPARENT, STYLE_SOLID, SYLE_DOTTED, STYLE_DASHED.
Note there's no Border.STYLE_FILLED
in that list.
精彩评论