java - how to make Indeterminate progressbar look nicely? -
i'm using nimbus lookandfill
uimanager.setlookandfeel("com.sun.java.swing.plaf.nimbus.nimbuslookandfeel");
and indeterminate jprogressbar looks that:
http://img15.imageshack.us/img15/9470/uglyprogress.jpg
can make looks better?
there's easier solution. can copy progress bar ui defaults before setting nimbus look-and-feel , set them after. nimbus , feel without progress bar styling.
// copy progress bar defaults hashmap<object, object> progressdefaults = new hashmap<>(); for(map.entry<object, object> entry : uimanager.getdefaults().entryset()){ if(entry.getkey().getclass() == string.class && ((string)entry.getkey()).startswith("progressbar")){ progressdefaults.put(entry.getkey(), entry.getvalue()); } } // set nimbus uimanager.setlookandfeel("com.sun.java.swing.plaf.nimbus.nimbuslookandfeel"); // copy progress bar defaults for(map.entry<object, object> entry : progressdefaults.entryset()){ uimanager.getdefaults().put(entry.getkey(), entry.getvalue()); }
Comments
Post a Comment