|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object javax.swing.AbstractAction javax.swing.text.TextAction javax.swing.text.StyledEditorKit.StyledTextAction javax.swing.text.StyledEditorKit.ForegroundAction
public static class StyledEditorKit.ForegroundAction
设置前景色的操作。此操作为当前选中的目标 JEditorPane 的范围设置 StyleConstants.Foreground
属性。该操作通过在与目标 JEditorPane 相关联的样式文档上调用 StyledDocument.setCharacterAttributes
来完成。
如果目标文本组件被指定为 ActionEvent 的源,则存在一个命令字符串,该命令字符串将被解释成为前景色。调用 Color.decode
来解释该字符串,而且因此对该方法而言,它是合法的输入。
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
字段摘要 |
---|
从类 javax.swing.AbstractAction 继承的字段 |
---|
changeSupport, enabled |
从接口 javax.swing.Action 继承的字段 |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
构造方法摘要 | |
---|---|
StyledEditorKit.ForegroundAction(String nm,
Color fg)
创建新的 ForegroundAction。 |
方法摘要 | |
---|---|
void |
actionPerformed(ActionEvent e)
设置前景色。 |
从类 javax.swing.text.StyledEditorKit.StyledTextAction 继承的方法 |
---|
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes |
从类 javax.swing.text.TextAction 继承的方法 |
---|
augmentList, getFocusedComponent, getTextComponent |
从类 javax.swing.AbstractAction 继承的方法 |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
从类 java.lang.Object 继承的方法 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public StyledEditorKit.ForegroundAction(String nm, Color fg)
nm
- 操作名fg
- 前景色方法详细信息 |
---|
public void actionPerformed(ActionEvent e)
e
- 操作事件
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。