开发者

Can one set a border around a GaugeField?

开发者 https://www.devze.com 2023-03-22 22:33 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消