java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
javax.swing.text.StyledEditorKit.StyledTextAction
javax.swing.text.StyledEditorKit.ForegroundAction
- 所有已实现的接口:
ActionListener,Serializable,Cloneable,EventListener,Action
- 封闭类:
StyledEditorKit
设置前景色的动作。这会为目标 JEditorPane 的当前选定范围设置
StyleConstants.Foreground 属性。这是通过在与目标 JEditorPane 关联的样式化文档上调用 StyledDocument.setCharacterAttributes 来完成的。
如果目标文本组件被指定为 ActionEvent 的源并且有命令字符串,则命令字符串将被解释为前景色。它将被称为 Color.decode 解释,因此应该是该方法的合法输入。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
-
字段摘要
在类 javax.swing.AbstractAction 中声明的字段
changeSupport, enabled在接口 javax.swing.Action 中声明的字段
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
构造方法总结
构造方法 -
方法总结
在类 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
-
构造方法详细信息
-
ForegroundAction
创建一个新的 ForegroundAction。- 参数:
nm- 动作名称fg- 前景色
-
-
方法详情
-
actionPerformed
设置前景色。- 参数:
e- 动作事件
-