1

enter image description here

I haven't been able to find a way to remove the highlight and keep my the black line border. Setting .setBorderPainted(false) fixes the highlight but also removes my border. Is there a way this can be fixed with look and feel or UIManager?

Code:

    this.downloadProgressBar.setBounds(16, 16, 512, 32);
    this.downloadProgressBar.setBorder(this.blackBorder);
    this.downloadProgressBar.setForeground(Color.pink);
    this.downloadProgressBar.setOpaque(false);
    this.downloadProgressBar.setString("75%");
    this.downloadProgressBar.setStringPainted(true);
    this.downloadProgressBar.setMinimum(0);
    this.downloadProgressBar.setMaximum(100);
    this.downloadProgressBar.setValue(75);
Maxwell
  • 133
  • 1
  • 7

1 Answers1

1

You can replace the default PLAF UI with a basic progress bar UI that does not have the pesky highlights as such:

(using a temp variable for more easily readable code):

JProgressBar bar = this.downloadProgressBar;
bar.setUI((ProgressBarUI)BasicProgressBarUI.createUI(bar));
SDJ
  • 4,083
  • 1
  • 17
  • 35