JXTitledPanel extends JXPanel { public Container getContentContainer() { if (contentPanel == null) { contentPanel = new JXPanel(); ((JXPanel) contentPanel).setBorder(BorderFactory .createEmptyBorder()); this.add(contentPanel, BorderLayout.CENTER); } return contentPanel; } JXTitledPanel();  JXTitledPanel(String title);  JXTitledPanel(String title, Container content); @Override TitledPanelUI getUI(); void setUI(TitledPanelUI ui); @Override String getUIClassID(); @Override void updateUI(); String getTitle(); void setTitle(String title); Container getContentContainer(); void setContentContainer(Container contentPanel); void setRightDecoration(JComponent decoration); JComponent getRightDecoration(); void setLeftDecoration(JComponent decoration); JComponent getLeftDecoration(); Font getTitleFont(); void setTitleFont(Font titleFont); void setTitlePainter(Painter p); Painter getTitlePainter(); Color getTitleForeground(); void setTitleForeground(Color titleForeground); static final String uiClassID; static final String LEFT_DECORATION; static final String RIGHT_DECORATION; }
@Test public void testLayoutOnLFChange() { JXTitledPanel titledPanel = new JXTitledPanel(); assertNotNull(titledPanel.getContentContainer()); titledPanel.getContentContainer().setLayout(new BorderLayout()); String lf = UIManager.getLookAndFeel().getName(); setSystemLF(!defaultToSystemLF); if (lf.equals(UIManager.getLookAndFeel().getName())) { LOG.info("cannot run layoutOnLFChange - equal LF" + lf); return; } SwingUtilities.updateComponentTreeUI(titledPanel); assertTrue(titledPanel.getContentContainer().getLayout() instanceof BorderLayout); }