JXHeader extends JXPanel { public Icon getIcon() { return icon; } JXHeader();  JXHeader(String title, String description);  JXHeader(String title, String description, Icon icon); @Override HeaderUI getUI(); void setUI(HeaderUI ui); @Override String getUIClassID(); @Override void updateUI(); void setTitle(String title); String getTitle(); void setDescription(String description); String getDescription(); void setIcon(Icon icon); Icon getIcon(); @Override void setFont(Font font); void setTitleFont(Font font); Font getTitleFont(); void setDescriptionFont(Font font); Font getDescriptionFont(); Color getTitleForeground(); void setTitleForeground(Color titleForeground); Color getDescriptionForeground(); void setDescriptionForeground(Color descriptionForeground); IconPosition getIconPosition(); void setIconPosition(IconPosition iconPosition); @Override Dimension getPreferredSize(); final static String uiClassID; }
@Test public void testIconDefaultA() { Icon icon = XTestUtils.loadDefaultIcon(); assertNotNull("sanity: default icon loaded", icon); UIManager.put("Header.defaultIcon", icon); JXHeader header = new JXHeader(); try { assertSame(icon, header.getIcon()); } finally { UIManager.put("Header.defaultIcon", null); } }
@Test public void testIconLabelDefaultB() { Icon icon = XTestUtils.loadDefaultIcon(); assertNotNull("sanity: default icon loaded", icon); UIManager.put("Header.defaultIcon", icon); JXHeader header = new JXHeader(); try { assertSame(icon, getIconLabel(header).getIcon()); } finally { UIManager.put("Header.defaultIcon", null); } }