• Post Reply Bookmark Topic Watch Topic
  • New Topic

UIManager bug?  RSS feed

 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when using WindowsLookandFeel on windows7 lots of UIManager changes to buttons look dont work at all, for example:
UIManager.put("Button.border",someborder) doesnt change borders at all,
UIManager.put("Button.highlight",somecolor) doesnt change color at all
UIManager.put("Button.light",somecolor) idem
while in windows classic look and feel everything works fine (and ugly), is it a misunderstanding between java and windows 7 or am i missing something?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you're missing is that your expectations are unfounded. The UIManager keys, and their usage, isn't in any way part of the public API.

Closed, not-a-bug
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but setting WindowsClassiclookandFeel and using one of the uimanager changes to the buttons i wrote, they affect not only my gui button but even system ones, like jfilechoosers, error/warning popups etc...
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, that's expected behavior. If you expected something different, it's your expectations that are at fault.

Your term 'system ones' is also unrealistic. Read the source of JFileChooser, JOptionPane ... and their UI delegates if you want to know what classes of components are housed in them.
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, its going too deep for my knowledge...
..but still unable to figure out why a UI command wich works under WindowsClassicLookAdnfeel doent work under WindowsLookAndfeel
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To really really understand that you would need to go through the code of the UI delegates in the two LaFs. Which might not be very easy to get, since they aren't open source.

Me, I wouldn't bother. If something undocumented works the way I hoped, I feel lucky. And try to keep in mind that it might not work under all circumstances.

If you want a LaF that's consistent across all platforms, Oracle has provided the cross platform LaF(s). Or if you feel adventurous, you could write your own.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!