JAVA 几个方法问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 16:50:57
SimpleAttributeSet colorset = new SimpleAttributeSet();
StyleConstants.setForeground(colorset, Color.RED);

什么意思,为什么?SimpleAttributeSet 是什么?请详细一点说明
说的好马上给分 在线等
谢谢

javax.swing.text
类 SimpleAttributeSet
java.lang.Object
javax.swing.text.SimpleAttributeSet
使用哈希表的 MutableAttributeSet 的直接实现

StyleConstants 是一个类,javax.swing.text 中 setForeground 是他的方法是用来设置前景色的

setForeground(MutableAttributeSet a, Color fg)
a - 属性集
fg - 颜色

包:java.lang.Object
javax.swing.text.SimpleAttributeSet
All Implemented Interfaces: 所有的接口:
AttributeSet , Cloneable , MutableAttributeSet , Serializable AttributeSet , Cloneable , MutableAttributeSet , 序列化

--------------------------------------------------------------------------------

public class SimpleAttributeSet公共类SimpleAttributeSet
extends Object扩展对象
implements MutableAttributeSet , Serializable , Cloneable实施MutableAttributeSet , 序列化 , Cloneable
A straightforward implementation of MutableAttributeSet using a hash table
.一个简单的执行MutableAttributeSet使用哈希表。

StyleConstants 是一个类,javax.swing.text 中 s