List of utility methods to do Swing UIManager
void | fixHtmlDisplay(JComponent component) This method fixes the display of HTML enabled components (like JEditorPanes and JTextPanes). Font defaultFont = UIManager.getFont("Button.font"); String stylesheet = "body { margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; font-family: " + defaultFont.getName() + "; font-size: " + defaultFont.getSize() + "pt; }" + "a, p, li { margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; font-family: " + defaultFont.getName() + "; font-size: " + defaultFont.getSize() + "pt; }"; try { HTMLDocument doc = null; if (component instanceof JEditorPane) { ... |
long | getAnimationSpeed() Returns the length of time GUI animations take, in milliseconds. long speed = -1; ClassLoader cl = (ClassLoader) UIManager.get("ClassLoader"); if (cl != null) { String managerClassName = LAFWIDGET_PKG + "animation.AnimationConfigurationManager"; Class<?> managerClazz = Class.forName(managerClassName, true, cl); Method m = managerClazz.getMethod("getInstance"); Object manager = m.invoke(null); m = managerClazz.getMethod("getTimelineDuration"); ... |
ClassLoader | getClassLoaderForResources() get Class Loader For Resources ClassLoader cl = (ClassLoader) UIManager.get("ClassLoader"); if (cl == null) cl = Thread.currentThread().getContextClassLoader(); return cl; |
ClassLoader | getClassLoaderForResources() Returns the class loader for loading the resource files. ClassLoader cl = (ClassLoader) UIManager.get("ClassLoader"); if (cl == null) cl = Thread.currentThread().getContextClassLoader(); return cl; |
Color | getDark() get Dark return UIManager.getColor(TABLE_FOREGROUND_COLOR_KEY);
|
Color | getDefaultActiveBackgroundColour() get Default Active Background Colour if (defaultActiveBackgroundColour == null) { if (!isWindowsLookAndFeel()) { Color color = UIManager.getColor("activeCaptionBorder"); if (color == null) { color = UIManager.getColor("controlShadow"); defaultActiveBackgroundColour = getBrighter(color, 0.85); } else { ... |
SimpleAttributeSet | getDefaultAttributeSet() get Default Attribute Set SimpleAttributeSet attrSet = new SimpleAttributeSet(); Font f = UIManager.getFont("Label.font"); StyleConstants.setFontFamily(attrSet, f.getFamily()); StyleConstants.setFontSize(attrSet, f.getSize()); StyleConstants.setBold(attrSet, false); StyleConstants.setItalic(attrSet, (f.getStyle() & Font.ITALIC) != 0); return attrSet; |
int | getDefaultFieldHeigth() get Default Field Heigth if (defaultFieldHeigth <= 0) { JTextField jtf = new JTextField(); jtf.setText("1234567890"); defaultFieldHeigth = jtf.getPreferredSize().height; if (UIManager.getLookAndFeel() != null && UIManager.getLookAndFeel().getClass().getName() .equals("com.sun.java.swing.plaf.gtk.GTKLookAndFeel")) { defaultFieldHeigth -= 4; if (defaultFieldHeigth < 21) { defaultFieldHeigth = 21; return defaultFieldHeigth; |
Color | getDefaultForeground() Returns the default color for foreground in user's color scheme. return UIManager.getColor("textText"); |
Color | getDefaultInactiveBackgroundColour() get Default Inactive Background Colour if (defaultInactiveBackgroundColour == null) { defaultInactiveBackgroundColour = UIManager.getColor("control"); return defaultInactiveBackgroundColour; |