aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How/Where can i find all swing properties keys ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How/Where can i find all swing properties keys ?" Watch "How/Where can i find all swing properties keys ?" New topic
Author

How/Where can i find all swing properties keys ?

Esmaeil Ashrafi
Ranch Hand

Joined: Feb 22, 2010
Posts: 73
Hi
Recently i needed to override dome default values of swing properties...and i got the perfect answer from Rob Prime in this thread

After that i interested to find a way to have all these pairs (simply HashTable keys and values elements) to override them at the startup of applications to make custom values. So firstly I checked the documentations and source codes of jdk6u17 APIs and currently passing lots of pages of Google results and the most and only useful things i found were two code snippets mentioned below :


and another one is almost same...

They will print out a lot of information though, but for example you can not find a key such OptionPane.yesButtonText or OptionPane.noButtonText or OptionPane.cancelButtonText or even swing.boldMetal that i used them as the key argument in method UIManager.put in my current application and brought an example in the thread mentioned before.

I'm really getting a headache cause of searching, neither i couldn't find the default values from source code (i guess they made from some source code i don't have them :
This is a part of UIManager source code i think (by tracking code snippets) is exactly where the table made, but have no source code :


Am I thinking about secrests or ...

Sombody,please, correct me


I'm really tired of being engaged with stuff other than Java and programming

Wish to get back soon to my love...
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2182
    
    7
There is no way to find all the property keys. In many cases a default value is hardcoded in the class and then the code checks to see if an override has been provided in the UIManager.

Secret Swing Properties list some of these properties.
Esmaeil Ashrafi
Ranch Hand

Joined: Feb 22, 2010
Posts: 73
Thanks

Alright,I think these are really SECRETs and maybe nobody give the all keys (s)he knows...
no problem, maybe whenever i need a special key somebody like Rob Prime again will kindly give that key (at least i would hope)

But you say these keys are usually hardcoded in the class, well, doesn't these classes have a source code ??

kind regards

P.S: about the link to "swing secrets", i said i searched a lot (really a lot) and that was one of the first results, but for example the keys dear leader,Rob, gave me wasn't there !
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Rob Camick wrote:There is no way to find all the property keys. In many cases a default value is hardcoded in the class and then the code checks to see if an override has been provided in the UIManager.

Secret Swing Properties list some of these properties.

How can you not promote your own UIManager Defaults application? I became aware of it through this thread.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Esmaeil Ashrafi
Ranch Hand

Joined: Feb 22, 2010
Posts: 73
Thank you Robs, both.

to the Ranch
Brandon Murphy
Greenhorn

Joined: Dec 20, 2010
Posts: 3
This is kind of an old thread but it is something that come up a lot. I have done just what you are saying in an app I wrote, I figured I would share it here in case anyone comes upon this thread (which they most certainly will). You can get the app, and more importantly the source code for it from here https://sites.google.com/site/hopsof/java-components-1/tools/uimanagerdefaultslookup that should show you how to do what you are asking, or if nothing else provide you with an easy way to retrieve the key-value pairs.

Thanks!
Brandon
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I'm not gunna run a .jar from an unknown source,
so I downloaded the .src .zip, read it, looked ok,
but, trying to compile produced numerous errors.

Thanks anyway, but I'll stick with Rob Camick's version.
Gagandeep Bali
Greenhorn

Joined: Jan 13, 2013
Posts: 2
-------------
Gagandeep Bali
Greenhorn

Joined: Jan 13, 2013
Posts: 2
Brandon Murphy wrote:This is kind of an old thread but it is something that come up a lot. I have done just what you are saying in an app I wrote, I figured I would share it here in case anyone comes upon this thread (which they most certainly will). You can get the app, and more importantly the source code for it from here https://sites.google.com/site/hopsof/java-components-1/tools/uimanagerdefaultslookup that should show you how to do what you are asking, or if nothing else provide you with an easy way to retrieve the key-value pairs.

Thanks!
Brandon


@Brandon : I just tested, compiling the source code and it's working fine in every respect. The link is really helpful as you mentioned.

I had tried Rob Camickr's program too, related to the same thingy. Both of them are too nice. Very helpful indeed.

Thankyou both of you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How/Where can i find all swing properties keys ?