Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How/Where can i find all swing properties keys ?

 
Esmaeil Ashrafi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rob Camick
Ranch Hand
Posts: 2582
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20529
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Esmaeil Ashrafi
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Robs, both.

to the Ranch
 
Brandon Murphy
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-------------
 
Gagandeep Bali
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic