使用した.setBackground
および.setForeground
そして、それらは機能しませんでした。色はオレンジのようで、変更できません。
これらの値はあなたにぴったりだと思います
UIManager.put("ProgressBar.background", Color.ORANGE);
UIManager.put("ProgressBar.foreground", Color.BLUE);
UIManager.put("ProgressBar.selectionBackground", Color.RED);
UIManager.put("ProgressBar.selectionForeground", Color.GREEN);
SetStringPaintedプロパティをtrueに設定する必要があります。
progressBar.setStringPainted(true);
progressBar.setForeground(Color.blue);
progressBar.setString("10%");