Forgot, here is a snippet the code I am trying to run presently... Why
would this nor work? Thought that the
SwingUtilities.updateComponentTreeUI() would update of the the objects
under frame.
static void setSwingLAF(JFrame frame, String targetTheme) {
try {
if (targetTheme.equalsIgnoreCase(Native)){
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(frame);
return;
}
if (targetTheme.equalsIgnoreCase(Java)){
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(frame);
return;
}
if (targetTheme.equalsIgnoreCase(Motif)){
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
SwingUtilities.updateComponentTreeUI(frame);
return;
}
if (targetTheme.equalsIgnoreCase(BrownSugar))
Plastic3DLookAndFeel.setMyCurrentTheme(new DarkStar());
else if (targetTheme.equalsIgnoreCase(DesertRed))
Plastic3DLookAndFeel.setMyCurrentTheme(new DesertRed());
else if (targetTheme.equalsIgnoreCase(DesertYellow))
else
Plastic3DLookAndFeel.setMyCurrentTheme(new SkyYellow());
Plastic3DLookAndFeel.setHighContrastFocusColorsEnabled(true);
UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY,
new Dimension(18, 18));
SwingUtilities.updateComponentTreeUI(frame);
} catch (Exception e) {
errorMessage(e);
}
}

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
IchBin - 27 Dec 2004 20:05 GMT
Not to be only a singular and circular dialectic ...
Sorry my code DOES work..
Only if I pass the correct component.

Signature
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances:
if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
Larry Barowski - 27 Dec 2004 20:07 GMT
> Forgot, here is a snippet the code I am trying to run presently... Why
> would this nor work? Thought that the
> SwingUtilities.updateComponentTreeUI() would update of the the objects
> under frame.
It will, but it may have problems for certain components, and it
won't get owned windows. Also you may need to call validate()
on the frames to see the effects. The usual method to get all
frames and dialogs is something like:
void updateAllUI() {
Frame[] frames = Frame.getFrames();
for(int f = 0; f < frames.length; f++) {
updateComponentTreeUI(frames[f]);
frames[f].validate();
Window[] windows = frames[f].getOwnedWindows();
for(int w = 0; w < windows.length; w++) {
updateComponentTreeUI(windows[w]);
windows[w].validate();
}
}
}
where updateComponentTreeUI() could be from SwingUtilities
or your own if the SwingUtilities one gives you problems.
Also keep in mind that any components that are not attached
to a Window will not get updated. So if you have popup menus
or reference components used in rendering others, etc., you
will need to call updateUI() on them manually. Usually you
would do that in the updateUI() method of the enclosing
class (if they are static, this may result in multiple updates,
which won't hurt anything), or by using a global UI update
mechanism with which you can register such components.