Forums Register Login

How/Where can i find all swing properties keys ?

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 !
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
Thank you Robs, both.

to the Ranch
1
+Pie Number of slices to send: Send
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
1
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
-------------
+Pie Number of slices to send: Send
 

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.
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5823 times.
Similar Threads
Problem wiht the load() method while using the Properties object
Please Help: Putting Vector objects into HashMap
hashCode() and equals() - How it is possible
danchisholm.net HashMap Question
Using Properties instead of HashMap when dealing with Strings
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:53:24.