Last active
May 24, 2018 11:17
-
-
Save kleinlennart/4a41f7466f7a7de9727182363c032168 to your computer and use it in GitHub Desktop.
Default Generater for JProgressBar (Colour setter not working on MacOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIManager.put("ProgressBar.selectionBackground", Color.red); | |
UIManager.put("ProgressBar.selectionForeground", Color.red); | |
UIManager.put("ProgressBar.foreground", Color.red); | |
UIManager.put("ProgressBar.background", Color.red); | |
JProgressBar bar = new JProgressBar(); | |
bar.setMaximum(50); | |
bar.setMinimum(0); | |
bar.setBounds(30, 118, 235, 41); | |
bar.setValue(n); | |
bar.setString(bar.getValue() + "/" + bar.getMaximum() + " HP"); | |
bar.setStringPainted(true); | |
frame.getContentPane().add(bar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment