Menu

#4 Changing the Look and Feel

open
None
5
2007-11-01
2007-10-30
Henry Wong
No

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.

Discussion

  • John Dickerson

    John Dickerson - 2007-11-01

    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.

     
  • John Dickerson

    John Dickerson - 2007-11-01
    • assigned_to: nobody --> prometheas
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.