- java.lang.Object
 -  
      
- javax.swing.plaf.synth.SynthStyleFactory
 
 
-  
       
public abstract class SynthStyleFactory extends Object
工厂用于获取SynthStyles。 SynthComponentUI的每一个都将调用当前的SynthStyleFactory以获得他们拥有的每个不同区域的SynthStyle。以下示例创建一个自定义
SynthStyleFactory,它返回基于Region的不同样式:class MyStyleFactory extends SynthStyleFactory { public SynthStyle getStyle(JComponent c, Region id) { if (id == Region.BUTTON) { return buttonStyle; } else if (id == Region.TREE) { return treeStyle; } return defaultStyle; } } SynthLookAndFeel laf = new SynthLookAndFeel(); UIManager.setLookAndFeel(laf); SynthLookAndFeel.setStyleFactory(new MyStyleFactory());- 从以下版本开始:
 - 1.5
 - 另请参见:
 -  
         
SynthStyleFactory,SynthStyle 
 
-  
        
       
-  
             
方法详细信息
-  
getStyle
public abstract SynthStyle getStyle(JComponent c, Region id)
返回指定Component的样式。- 参数
 -  
              
c- 组件要求 -  
              
id- 区域标识符 - 结果
 - 区域的SynthStyle。
 
 
 -  
 
 -