protected void installDefaults(JXHeader h) { gradientLightColor = UIManager.getColor("JXHeader.startBackground"); if (gradientLightColor == null) { // fallback to white gradientLightColor = Color.WHITE; } gradientDarkColor = UIManager.getColor("JXHeader.background"); // for backwards compatibility (mostly for substance and synthetica, // I suspect) I'll fall back on the "control" color if JXHeader.background // isn't specified. if (gradientDarkColor == null) { gradientDarkColor = UIManager.getColor("control"); } Painter p = h.getBackgroundPainter(); if (p == null || p instanceof PainterUIResource) { h.setBackgroundPainter(createBackgroundPainter()); } // title properties Font titleFont = h.getTitleFont(); if (titleFont == null || titleFont instanceof FontUIResource) { titleFont = UIManager.getFont("JXHeader.titleFont"); // fallback to label font titleLabel.setFont(titleFont != null ? titleFont : UIManager.getFont("Label.font")); } Color titleForeground = h.getTitleForeground(); if (titleForeground == null || titleForeground instanceof ColorUIResource) { titleForeground = UIManager.getColor("JXHeader.titleForeground"); // fallback to label foreground titleLabel.setForeground( titleForeground != null ? titleForeground : UIManager.getColor("Label.foreground")); } titleLabel.setText(h.getTitle()); // description properties Font descFont = h.getDescriptionFont(); if (descFont == null || descFont instanceof FontUIResource) { descFont = UIManager.getFont("JXHeader.descriptionFont"); // fallback to label font descriptionPane.setFont(descFont != null ? descFont : UIManager.getFont("Label.font")); } Color descForeground = h.getDescriptionForeground(); if (descForeground == null || descForeground instanceof ColorUIResource) { descForeground = UIManager.getColor("JXHeader.descriptionForeground"); // fallback to label foreground descriptionPane.setForeground( descForeground != null ? descForeground : UIManager.getColor("Label.foreground")); } descriptionPane.setText(h.getDescription()); }