List of utility methods to do Swing UIManager
void | adjustBackground(JComponent c) Change background of given component to light gray on Mac look and feel when the component is in a tabbed container and its background hasn't been already changed (is instance of UIResource). if (!isAquaLaF || useDefaultBackground) { return; if (!isInTabbedContainer(c)) { return; Color currentBackground = c.getBackground(); if (currentBackground instanceof UIResource) { ... |
void | applySizeVariant(JComponent c) apply Size Variant String p = (String) c.getClientProperty("JComponent.sizeVariant"); if (p == null) { } else if (p.equals("regular")) { c.setFont(UIManager.getFont("SystemFont")); } else if (p.equals("small")) { c.setFont(UIManager.getFont("SmallSystemFont")); } else if (p.equals("mini")) { c.setFont(UIManager.getFont("MiniSystemFont")); ... |
void | beep(Component comp) beep UIManager.getLookAndFeel().provideErrorFeedback(comp); |
boolean | canChangeSize() can Change Size return UIManager.getLookAndFeelDefaults().get("defaultFont") != null; |
void | clearErrorLabel(JLabel label) clear Error Label label.setIcon(null);
label.setForeground(UIManager.getColor("Label.foreground"));
|
void | configureStandardUI() Sets up the standard UI. System.setProperty("apple.laf.useScreenMenuBar", Boolean.TRUE.toString()); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex) { ex.printStackTrace(System.err); |
int | createDefaultHorizontalAlignment() create Default Horizontal Alignment int swingAlign = SwingConstants.RIGHT; String defaultAlignment = UIManager.getDefaults().getString("Label.defaultHorizontalAlignment"); if (defaultAlignment != null) { if ("LEFT".equalsIgnoreCase(defaultAlignment)) { swingAlign = SwingConstants.LEFT; } else if ("RIGHT".equalsIgnoreCase(defaultAlignment)) { swingAlign = SwingConstants.RIGHT; } else if ("CENTER".equalsIgnoreCase(defaultAlignment)) { ... |
JLabel | createErrorLabel(String errorMsg) create Error Label JLabel label = new JLabel("<html><font color=red>" + errorMsg + "</font></html>"); label.setIcon(UIManager.getIcon("OptionPane.errorIcon")); return label; |
JPanel | createFlow(final Object... components) create Flow return createFlow(FlowLayout.LEFT, 0, components);
|
int | createHorizontalAlignment(int scoutAlign) create Horizontal Alignment switch (scoutAlign) { case -1: { return SwingConstants.LEFT; case 0: { return SwingConstants.CENTER; case 1: { ... |