protected void installDefaults(AbstractButton b) { // load shared instance defaults String pp = getPropertyPrefix(); defaultTextShiftOffset = UIManager.getInt(pp + "textShiftOffset"); // set the following defaults on the button if (b.isContentAreaFilled()) { LookAndFeel.installProperty(b, "opaque", Boolean.TRUE); } else { LookAndFeel.installProperty(b, "opaque", Boolean.FALSE); } if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) { b.setMargin(UIManager.getInsets(pp + "margin")); } LookAndFeel.installColorsAndFont(b, pp + "background", pp + "foreground", pp + "font"); LookAndFeel.installBorder(b, pp + "border"); Object rollover = UIManager.get(pp + "rollover"); if (rollover != null) { LookAndFeel.installProperty(b, "rolloverEnabled", rollover); } LookAndFeel.installProperty(b, "iconTextGap", new Integer(4)); }
public void installUI(JComponent jComponent) { grid = (JGrid) jComponent; rendererPane = new CellRendererPane(); grid.add(rendererPane); gridHeader = (JGrid) jComponent; jComponent.setOpaque(false); LookAndFeel.installColorsAndFont( jComponent, "TableHeader.background", "TableHeader.foreground", "TableHeader.font"); installDefaults(); installListeners(); installKeyboardActions(); }
protected void installDefaults(JPanel p) { LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font"); LookAndFeel.installBorder(p, "Panel.border"); LookAndFeel.installProperty(p, "opaque", Boolean.TRUE); }