Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > A Look and Feel Question

Reply
Thread Tools

A Look and Feel Question

 
 
WDW
Guest
Posts: n/a
 
      08-19-2004
How can I reset the UIDefaults before installing a new theme
I will explain ...
I set the cuurent theme to my own theme
MetalLookAndFeel.setCurrentTheme(myTheme);
with following changes to the UIDfeaults:
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
Color c1 = new Color(255, 0, 255);
table.put("Button.foreground", c1);
}
After changing the theme to another theme - ie DefaultMetalThem - the
foreground color of the button is still pink ...

Some help please
TIA
Willy
 
Reply With Quote
 
 
 
 
Thomas Fritsch
Guest
Posts: n/a
 
      08-19-2004
WDW wrote:

>How can I reset the UIDefaults before installing a new theme
>I will explain ...
>I set the cuurent theme to my own theme
>MetalLookAndFeel.setCurrentTheme(myTheme);
>with following changes to the UIDfeaults:
>public void addCustomEntriesToTable(UIDefaults table) {
>super.addCustomEntriesToTable(table);
>Color c1 = new Color(255, 0, 255);
>table.put("Button.foreground", c1);
>}
>After changing the theme to another theme - ie DefaultMetalThem - the
>foreground color of the button is still pink ...
>
>Some help please
>TIA
>Willy
>
>

May be
SwingUtilities.updateComponentTreeUI(yourFrame);
fixes this.
See http://java.sun.com/docs/books/tutor...f.html#dynamic

--
Thomas<dot>Fritsch<squiggle>ops<dot>de

 
Reply With Quote
 
 
 
 
zoopy
Guest
Posts: n/a
 
      08-19-2004
On 19-8-2004 12:51, WDW wrote:

> How can I reset the UIDefaults before installing a new theme
> I will explain ...
> I set the cuurent theme to my own theme
> MetalLookAndFeel.setCurrentTheme(myTheme);
> with following changes to the UIDfeaults:
> public void addCustomEntriesToTable(UIDefaults table) {
> super.addCustomEntriesToTable(table);
> Color c1 = new Color(255, 0, 255);
> table.put("Button.foreground", c1);
> }
> After changing the theme to another theme - ie DefaultMetalThem - the
> foreground color of the button is still pink ...
>
> Some help please
> TIA
> Willy



<untested>
UIManager.getDefaults().putAll(new MetalLookAndFeel().getDefaults());
</untested>

--
Regards,
Z.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-19-2004
On Thu, 19 Aug 2004 13:58:41 +0200, Thomas Fritsch wrote:
> WDW wrote:
>
>>How can I reset the UIDefaults before installing a new theme


<http://www.physci.org/codes/javafaq.jsp#cljg>
....
> May be
> SwingUtilities.updateComponentTreeUI(yourFrame);
> fixes this.
> See http://java.sun.com/docs/books/tutor...f.html#dynamic


See also a code example of same.
<http://www.physci.org/test/lnf>
links to source, and this 'full window' applet example..
<http://www.physci.org/test/lnf/fullwnd5.html>

HTH

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Look and feel Question Zvonko Java 2 07-12-2006 05:40 AM
Need advice on separating content from look and feel =?Utf-8?B?Sm9l?= ASP .Net 4 01-20-2005 09:10 PM
Recreate msdn drill down look and feel Mark ASP .Net 2 02-23-2004 09:37 PM
Specifying look and feel for embedded windows user control Marina ASP .Net 3 01-28-2004 05:14 PM
Consistent Look and Feel Nick ASP .Net 5 01-15-2004 07:41 AM



Advertisments