本文整理了Java中javax.swing.JTextPane.isEnabled()
方法的一些代码示例,展示了JTextPane.isEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.isEnabled()
方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:isEnabled
暂无
代码示例来源:origin: org.java.net.substance/substance
public void propertyChange(PropertyChangeEvent evt) {
if ("font".equals(evt.getPropertyName())) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// remember the caret location - issue 404
int caretPos = textPane.getCaretPosition();
textPane.updateUI();
textPane.setCaretPosition(caretPos);
Container parent = textPane.getParent();
if (parent != null) {
parent.invalidate();
parent.validate();
}
}
});
}
if ("enabled".equals(evt.getPropertyName())) {
transitionModel.setEnabled(textPane.isEnabled());
}
}
};
代码示例来源:origin: com.github.insubstantial/substance
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("font".equals(evt.getPropertyName())) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// remember the caret location - issue 404
int caretPos = textPane.getCaretPosition();
textPane.updateUI();
textPane.setCaretPosition(caretPos);
Container parent = textPane.getParent();
if (parent != null) {
parent.invalidate();
parent.validate();
}
}
});
}
if ("enabled".equals(evt.getPropertyName())) {
transitionModel.setEnabled(textPane.isEnabled());
}
}
};
代码示例来源:origin: org.java.net.substance/substance
/**
* Simple constructor.
*
* @param c
* Component (text pane).
*/
public SubstanceTextPaneUI(JComponent c) {
super();
this.textPane = (JTextPane) c;
this.transitionModel = new DefaultButtonModel();
this.transitionModel.setArmed(false);
this.transitionModel.setSelected(false);
this.transitionModel.setPressed(false);
this.transitionModel.setRollover(false);
this.transitionModel.setEnabled(this.textPane.isEnabled());
this.stateTransitionTracker = new StateTransitionTracker(this.textPane,
this.transitionModel);
}
代码示例来源:origin: com.github.insubstantial/substance
/**
* Simple constructor.
*
* @param c
* Component (text pane).
*/
public SubstanceTextPaneUI(JComponent c) {
super();
this.textPane = (JTextPane) c;
this.transitionModel = new DefaultButtonModel();
this.transitionModel.setArmed(false);
this.transitionModel.setSelected(false);
this.transitionModel.setPressed(false);
this.transitionModel.setRollover(false);
this.transitionModel.setEnabled(this.textPane.isEnabled());
this.stateTransitionTracker = new StateTransitionTracker(this.textPane,
this.transitionModel);
}
内容来源于网络,如有侵权,请联系作者删除!