Setting the colors of a JProgressBar text

前端 未结 2 598
南笙
南笙 2020-12-16 21:21

I have these progress bars:

\"Sample

I\'m trying to set the color o

2条回答
  •  长情又很酷
    2020-12-16 21:51

    By message with UIDefaults,

    ProgressBar.background is the background color
    ProgressBar.foreground is the cell color
    ProgressBar.selectionBackground is the text color outside cells
    ProgressBar.selectionForeground is the text colot INSIDE cells
    
    UIManager.put("ProgressBar.selectionForeground", Color.black);
    UIManager.put("ProgressBar.selectionBackground", Color.black);
    

提交回复
热议问题