List of utility methods to do Swing UIManager
JSeparator | createHorizontalLine() create Horizontal Line JSeparator horizontalSeparator = new JSeparator() { private final int maxHeight = isNimbusLookAndFeel() ? 2 : isGTKLookAndFeel() ? 3 : isAquaLookAndFeel() ? 6 : 1; private final boolean customPaint = isAquaLookAndFeel(); public Dimension getMinimumSize() { return getPreferredSize(); public Dimension getMaximumSize() { ... |
JLabel | createMessageLabel(String message) create Message Label Color color = UIManager.getColor("OptionPane.messageForeground"); Font messageFont = UIManager.getFont("OptionPane.messageFont"); JLabel label = new JLabel(message, JLabel.LEADING); if (color != null) { label.setForeground(color); if (messageFont != null) { label.setFont(messageFont); ... |
JTabbedPane | createTabbedPane(int tabPlacement) create Tabbed Pane switch (tabPlacement) { case JTabbedPane.LEFT: case JTabbedPane.RIGHT: Object textIconGap = UIManager.get("TabbedPane.textIconGap"); Insets origInsets = UIManager.getInsets("TabbedPane.tabInsets"); Insets tabInsets = origInsets; if (tabInsets == null) { tabInsets = new Insets(2, 2, 2, 2); ... |
void | decorateMissingValue(JComponent jComponent, boolean missingValueState) decorate Missing Value jComponent.setBackground(missingValueState ? requiredBgColor : defaultBgColor); |
int | defaultColumnWidth() Column width for JTable, based on global defaults. return defaultTableCellSize().width;
|
T | destylize(T comp) destylize Color c = UIManager.getColor("Panel.background"); Color background = new Color(c.getRed(), c.getGreen(), c.getBlue()); c = UIManager.getColor("Panel.foreground"); Color foreground = new Color(c.getRed(), c.getGreen(), c.getBlue()); comp.setBackground(background); comp.setForeground(foreground); comp.setBorder(null); return comp; ... |
Icon | disabledIcon(JComponent parent, Icon icon) Gets a "disabled" icon according to the current look and feel. if (icon == null) return null; Icon result = UIManager.getLookAndFeel().getDisabledIcon(parent, icon); if (result != null) return result; if (parent != null) { int width = icon.getIconWidth(); int height = icon.getIconHeight(); ... |
void | disablePaintSliderValue() disable Paint Slider Value UIManager.put("Slider.paintValue", false);
|
void | drawVistaBackground(Graphics g, Component b, String prefix) draw Vista Background drawVistaBackground(g, 0, 0, b.getWidth(), b.getHeight(), UIManager.getColor(prefix + ".gradientStart"), UIManager.getColor(prefix + ".gradientMiddle"), UIManager.getColor(prefix + ".gradientEnd")); |
void | fixGtkPopupStyle() fix Gtk Popup Style if (!isUnderGTKLookAndFeel()) { return; final SynthStyleFactory original = SynthLookAndFeel.getStyleFactory(); SynthLookAndFeel.setStyleFactory(new SynthStyleFactory() { @Override public SynthStyle getStyle(final JComponent c, final Region id) { final SynthStyle style = original.getStyle(c, id); ... |