List of utility methods to do Swing UIManager
JTabbedPane | getNestedTabbedPane(int orient, int top, int left, int bottom, int right) Make a JTabbedPane without some of its border Insets oldInsets = UIManager.getInsets("TabbedPane.contentBorderInsets"); Insets insets = new Insets(top, left, bottom, right); UIManager.put("TabbedPane.contentBorderInsets", insets); JTabbedPane tabPane = new JTabbedPane(orient); UIManager.put("TabbedPane.contentBorderInsets", oldInsets); return tabPane; |
String | getNimbusClassName() get Nimbus Class Name for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { return info.getClassName(); return null; |
Integer | getPropertyMaxGutterIconWidth(final String propertyPrefix) get Property Max Gutter Icon Width return (Integer) UIManager.get(propertyPrefix + ".maxGutterIconWidth"); |
int | getRowHeight(java.awt.Component c) Returns the row height (font height) of 'c' of the reference component if 'c' is null. java.awt.Font f = (c != null) ? c.getFont() : null; if (f == null) f = getRefComp().getFont(); if (f == null) f = javax.swing.UIManager.getFont("Label.font"); return (c != null ? c : getRefComp()).getFontMetrics(f).getHeight(); |
JPanel | getSeparator() Builds a separator panel JPanel sep = new JPanel() { private static final long serialVersionUID = 3543668010487797227L; public void paintComponent(Graphics g) { int half = getWidth() / 2; g.setColor(UIManager.getColor("controlShadow")); g.drawLine(half, 0, half, getHeight()); }; ... |
int | getStringWidth(final String aString) Returns the string width for the default label font and string. return getStringWidth(UIManager.getFont("Label.font"), aString); |
int | getSystemDefaultModifier() gives default modifier of the current OS. if (!(UIManager.getLookAndFeel().getID().equals(METAL_LAF_ID))) { int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); if (mask == Event.META_MASK) { return KeyEvent.VK_META; } else if (mask == Event.ALT_MASK) { return KeyEvent.VK_ALT; return KeyEvent.VK_CONTROL; |
Icon | getTitleBarIcon() Obtains the title bar icon configured for this SOLA application based on the LAF theme. Icon result = UIManager.getIcon("solaTitleBarIcon"); if (result == null) { result = new ImageIcon(); return result; |
Color | getToolTipBackground() Gets the sampleToolTip attribute of the TapUtils class return (Color) UIManager.get("ToolTip.background"); |
Color | getToolTipBackground() Returns the default background color to use for tool tip windows. Color c = UIManager.getColor("ToolTip.background"); boolean isNimbus = isNimbusLookAndFeel(); if (c == null || isNimbus) { c = UIManager.getColor("info"); if (c == null || (isNimbus && isDerivedColor(c))) { c = SystemColor.info; if (c instanceof ColorUIResource) { c = new Color(c.getRGB()); return c; |