本文整理了Java中javax.swing.JTextPane.getForeground()
方法的一些代码示例,展示了JTextPane.getForeground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.getForeground()
方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:getForeground
暂无
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
/** Constructs a new read key panel. */
public ReadKeyPanel() {
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
passwdField.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: net.java.truevfs/truevfs-key-swing
/** Constructs a new read key panel. */
ReadKeyPanel() {
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
passwdField.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-zip
/** Constructs a new write key panel. */
public WriteKeyPanel() {
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
newPasswd1Field.getDocument().addDocumentListener(dl);
newPasswd2Field.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: net.java.truecommons/truecommons-key-swing
/** Constructs a new read key panel. */
ReadKeyPanel(final SwingPromptingPbeParametersView<?, ?> view) {
assert null != view;
this.view = view;
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
passwdField.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: net.java.truecommons/truecommons-key-swing
/** Constructs a new write key panel. */
WriteKeyPanel(final SwingPromptingPbeParametersView<?, ?> view) {
assert null != view;
this.view = view;
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
newPasswd1Field.getDocument().addDocumentListener(dl);
newPasswd2Field.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: net.java.truevfs/truevfs-key-swing
/** Constructs a new write key panel. */
WriteKeyPanel() {
initComponents();
final DocumentListener dl = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void removeUpdate(DocumentEvent e) {
setError(null);
}
@Override
public void changedUpdate(DocumentEvent e) {
setError(null);
}
};
newPasswd1Field.getDocument().addDocumentListener(dl);
newPasswd2Field.getDocument().addDocumentListener(dl);
authenticationPanel.getKeyFileDocument().addDocumentListener(dl);
defaultForeground = resource.getForeground();
}
代码示例来源:origin: otros-systems/otroslogviewer
loggerConfigTextPane.setCaretColor(loggerConfigTextPane.getForeground());
loggerConfigTextPane.setCaret(new DefaultCaret());
loggerConfigTextPane.getDocument().addDocumentListener(new DocumentChangeListener(this::updatePatterns));
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
private void maintainForegroundColor()
{
// Ensure text typed into the console uses the foreground color. If we don't set it here, the
// editor sometimes reuses a color from wherever the user may have moved the cursor in the console
// and pressed Enter.
_outputPanel.getInputAttributes();
SimpleAttributeSet sas = new SimpleAttributeSet();
StyleConstants.setForeground( sas, _outputPanel.getForeground() );
_outputPanel.setCharacterAttributes( sas, false );
}
}
代码示例来源:origin: nroduit/Weasis
+ Integer.toHexString((jTextPane1.getBackground().getRGB() & 0xffffff) | 0x1000000).substring(1)
+ ";color:#" //$NON-NLS-1$
+ Integer.toHexString((jTextPane1.getForeground().getRGB() & 0xffffff) | 0x1000000).substring(1)
+ ";margin:3;font-weight:normal;}"); //$NON-NLS-1$
jTextPane1.setContentType("text/html"); //$NON-NLS-1$
代码示例来源:origin: com.github.insubstantial/substance
@Override
public void run() {
if (textPane == null)
return;
Color foregr = textPane.getForeground();
if ((foregr == null) || (foregr instanceof UIResource)) {
textPane
.setForeground(SubstanceColorUtilities
.getForegroundColor(SubstanceLookAndFeel
.getCurrentSkin(textPane)
.getEnabledColorScheme(
SubstanceLookAndFeel
.getDecorationType(textPane))));
}
}
});
代码示例来源:origin: org.java.net.substance/substance
@Override
public void run() {
if (textPane == null)
return;
Color foregr = textPane.getForeground();
if ((foregr == null) || (foregr instanceof UIResource)) {
textPane
.setForeground(SubstanceColorUtilities
.getForegroundColor(SubstanceLookAndFeel
.getCurrentSkin(textPane)
.getEnabledColorScheme(
SubstanceLookAndFeel
.getDecorationType(textPane))));
}
}
});
内容来源于网络,如有侵权,请联系作者删除!