public void testSetUI() { ComponentUI componentUI1 = new BasicPanelUI(); ComponentUI componentUI2 = new BasicPanelUI(); panel = new JPanel(); ((JPanel) panel).getUI().uninstallUI(panel); panel.setUI(null); PropertyChangeController changeListener = new PropertyChangeController(); panel.addPropertyChangeListener(changeListener); panel.setUI(componentUI1); assertEquals(componentUI1, panel.ui); changeListener.checkPropertyFired(panel, "UI", null, componentUI1); changeListener.reset(); panel.setUI(componentUI2); changeListener.checkPropertyFired(panel, "UI", componentUI1, componentUI2); changeListener.reset(); panel.setUI(componentUI2); assertFalse(changeListener.isChanged("UI")); }
@Override public void updateUI() { setUI(new BasicPanelUI()); }
@Override public void updateUI() { setUI(new BasicPanelUI()); updateColors(); }