The porblem is that method doesn't apply it for whole app. As I mentioned in
original message
it applies it to most but not all the elements. :-/
>> How can I apply LAF (e.g. system default) to whole application?
>
[quoted text clipped - 3 lines]
>
> Steve
> The porblem is that method doesn't apply it for whole app. As I mentioned in
> original message
[quoted text clipped - 7 lines]
>>
>>Steve
SwingUtilities.updateComponentTreeUI(component);
You have to call it for every component that's not directly reachable
from your application's frame.

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
xarax - 07 Feb 2005 01:21 GMT
>> The porblem is that method doesn't apply it for whole app. As I mentioned in
>> original message
[quoted text clipped - 12 lines]
> You have to call it for every component that's not directly reachable from
> your application's frame.
A typical way to do this for the main component to set
up a listener interface where the other components
can register themselves for LAF update events.
The main component, somehow, sets an API that allows
other components to register their listeners. Whenever
the main component decides to change the LAF, it calls
all of the registered listeners to notify them that they
need to update their LAF. The custom event message can
contain the necessary details of the LAF changes, if needed.
Thus, the main component does not need to know all of
the other components in the application. The other components,
however, must know how to register/un-register their listeners.
Thomas Fritsch - 07 Feb 2005 15:03 GMT
>> The porblem is that method doesn't apply it for whole app. As I
>> mentioned in original message
[quoted text clipped - 12 lines]
> You have to call it for every component that's not directly reachable
> from your application's frame.
Just one addition to what the previous posters pointed out: A handy way
to get all(!) frames of your app is the static Frame.getFrames() method.
Frame frames[] = Frame.getFrames();
for (int i = 0; i < frames.length; i++)
SwingUtilities.updateComponentTreeUI(frames[i]);

Signature
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')
Roland - 07 Feb 2005 16:36 GMT
>>> The porblem is that method doesn't apply it for whole app. As I
>>> mentioned in original message
[quoted text clipped - 18 lines]
> for (int i = 0; i < frames.length; i++)
> SwingUtilities.updateComponentTreeUI(frames[i]);
I wasn't aware of the existence of Frame.getFrames(). I used a similar
technique as mentioned by xarax. I think I'll go and see if it can be
replaced by getFrames() in my app.

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
Karsten Lentzsch - 07 Feb 2005 19:18 GMT
> Just one addition to what the previous posters pointed out: A handy way
> to get all(!) frames of your app is the static Frame.getFrames() method.
> [...]
See also Frame#getOwnedWindows.
- Karsten