Re: UIDefaults.put() issue



On 2006-01-31, Ike penned:
> For whatever reason, I am unable to alter the value in the UIManager
> LookAndFeelDefaults table. I must be doing something stupid, and would
> appreciate any direction here.
>
> For example, if, as shown in the following lines, I set the L&F to "Motif,"
> and then subsequently seek to override the "DeskTopIconUI" entry in the
> table with MetalDesktopIconUI, then, iterate through the values in the
> table, the DesktopIconUI value is STILL
> com.sun.java.swing.plaf.motif.MotifDesktopIconUI. Why does it no accept my
> override to javax.swing.plaf.metal.MetalDesktopIconUI ? Thank you, Ike
>

If I understand what you're doing properly,
"com.sun.java.swing.plaf.motif.MotifDesktopIconUI" is actually a key.
So what you should do is something like:

UIManager.put("DesktopIconUI",
UIManager.get("com.sun.java.swing.plaf.motif.MotifDesktopIconUI"));


>
> UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
> UIManager.put("DesktopIconUI",
> "javax.swing.plaf.metal.MetalDesktopIconUI");
> UIDefaults def = UIManager.getLookAndFeelDefaults();
> Enumeration enum = def.keys();
> while (enum.hasMoreElements()) {
> Object item = enum.nextElement();
> System.out.println(item +" " + def.get(item));
> }
>
>
>

--
monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
.



Relevant Pages

  • UIDefaults.put() issue
    ... LookAndFeelDefaults table. ... I must be doing something stupid, ... and then subsequently seek to override the "DeskTopIconUI" entry in the ... the DesktopIconUI value is STILL ...
    (comp.lang.java.gui)
  • Re: [SLE] Problem with K3b and 9.1 [SOLVED - MAYBE]
    ... SuSEconfig could reset permissions in the secure and paranoid cases. ... To override that, one can put an entry in /etc/permissions.local (see the ...
    (SuSE)
  • Re: [SLE] - Konovalovs Midnight Commander
    ... which confuses MC. ... Add an entry to your .bashrc to override it e.g. ...
    (SuSE)
  • Re: insert a range of date
    ... By using "(" you make it a text entry. ... That will override any ... formatting and insert a US style date. ... Prev by Date: ...
    (microsoft.public.excel)
  • Numeric Entry in Tkinter
    ... Earlier I asked about limitting what a user can enter in an Entry. ... got a few greatly appreciated replies, but I was hoping it would be ... can override, when creating a class that inherits the Entry methods, ...
    (comp.lang.python)