Problem:
I noticed that the look & feel does not constantly change for all panels when the user makes a change.
Steps to reproduce:
- Start Class Finder. By default, the look & feel is
set to Windows.
- Select Find->Find Class menu item.
- Select Window->Preferences->Look and Feel->Metal
You will see the Class Find Panel change to the
Metal look and feel. Great!
- Now select Scan->Scan Directories menu item.
The Look and Feel for the buttons seems to still
be 'Windows' and not 'Metal'. Click on "Add
Location" and the dialog box also still retains the
'Windows' look and feel.
Logged In: YES
user_id=612121
Originator: NO
look at:
com.jes.classfinder.controller.action.menu.window.preferences.lookandfeel.ActionChangeLookAndFeel.java
look at the perform(..) method
See the code:
UIManager.setLookAndFeel( classNameLookAndFeel );
JFrame mainFrame = ( JFrame )controller.getMainFrame();
SwingUtilities.updateComponentTreeUI( mainFrame );
The reason all the panels are not changing is that SwingUtilities.updateComponentTreeUI( .. ) needs to be called on all panels that are not null which are not currently attached to the Frame.
The panels are stored in com.jes.classfinder.gui.panel.findclass.SingleSourceFilePanel.MainFramePanelHelperImpl.
If I were you I would add a method to MainFramePanelHelperImpl that is for updating all the panels that are not null. i.e. SwingUtilities.updateComponentTreeUI(..) is called on all panels which are not null in MainFramePanelHelperImpl.