• Post Reply Bookmark Topic Watch Topic
  • New Topic

something about LookAndFeel?  RSS feed

 
Ling Wang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the beginning of the program,I used UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel") to set the user interface style.It does work properly.But I want to change the style dynamicly by clicking some menuitem.In response to the menuitem actionevents,I used UIManager.setLookAndFeel to reset LookAndFeel,but the user interface does not change at all.How can I handle these?
 
Mark Brodziak
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After changing the look and feel, all objects that were painted in the old look and feel need to be repainted. The easiest way to do this is to use the following call:

This updates the entire component heirarchy beneath myComponent to use the new PLAF.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!