if (((String) title).startsWith("<html>") || ((String) title).startsWith("<HTML>")) {
_titleComponent = new JLabel(((String) title));
}
else {
String[] titles = fitInWidth((String) title, UIDefaultsLookup.getInt("OptionPane.bannerMaxCharsPerLine"));
JPanel titlePanel = new NullPanel();
titlePanel.setLayout(new BoxLayout(titlePanel, BoxLayout.Y_AXIS));
titlePanel.setOpaque(false);
titlePanel.add(Box.createGlue());
for (String s : titles) {
JLabel label = new JLabel(s);
label.setFont(label.getFont().deriveFont(UIDefaultsLookup.getInt("OptionPane.bannerFontStyle"), UIDefaultsLookup.getInt("OptionPane.bannerFontSize")));
Color color = UIDefaultsLookup.getColor("OptionPane.bannerForeground");
label.setForeground(color != null ? color : getPainter().getOptionPaneBannerForeground());
titlePanel.add(label);
}
titlePanel.add(Box.createGlue());
_titleComponent = titlePanel;
}
}
else if (title instanceof Component) {
_titleComponent = (Component) title;