javax.swing.text.JTextComponent.setUI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中javax.swing.text.JTextComponent.setUI()方法的一些代码示例,展示了JTextComponent.setUI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.setUI()方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:setUI

JTextComponent.setUI介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void propertyChange(PropertyChangeEvent evt) {
  Object newValue = evt.getNewValue();
  if ("UI".equals(evt.getPropertyName())
    && (newValue != null) && !(newValue instanceof BaseTextUI)
  ) {
    JTextComponent c = (JTextComponent)evt.getSource();
    EditorKit kit = ((TextUI)newValue).getEditorKit(c);
    if (kit instanceof BaseKit) {
      // BaseKit but not BaseTextUI -> restore BaseTextUI
      try {
        c.setUI((BaseTextUI)uiClass.newInstance());
      } catch (InstantiationException e) {
      } catch (IllegalAccessException e) {
      }
    }
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * Wraps and replaces the text components current UI by calling {@link #wrapUI(TextUI)}, if the
 * text components current UI is not an instance of the given wrapper class.
 * 
 * @param textComponent
 * @return <code>true</code> if the UI has been replaced
 */
protected boolean replaceUIIfNeeded(JTextComponent textComponent) {
  if (wrapperClass.isAssignableFrom(textComponent.getUI().getClass())) {
    return false;
  }
  textComponent.setUI(wrapUI(textComponent));
  return true;
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * Wraps and replaces the text components current UI by calling {@link #wrapUI(TextUI)}, if the
 * text components current UI is not an instance of the given wrapper class.
 * 
 * @param textComponent
 * @return <code>true</code> if the UI has been replaced
 */
protected boolean replaceUIIfNeeded(JTextComponent textComponent) {
  if (wrapperClass.isAssignableFrom(textComponent.getUI().getClass())) {
    return false;
  }
  textComponent.setUI(wrapUI(textComponent));
  return true;
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * Wraps and replaces the text components current UI by calling {@link #wrapUI(TextUI)}, if the
 * text components current UI is not an instance of the given wrapper class.
 * 
 * @param textComponent
 * @return <code>true</code> if the UI has been replaced
 */
protected boolean replaceUIIfNeeded(JTextComponent textComponent) {
  if (wrapperClass.isAssignableFrom(textComponent.getUI().getClass())) {
    return false;
  }
  textComponent.setUI(wrapUI(textComponent));
  return true;
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * Wraps and replaces the text components current UI by calling {@link #wrapUI(TextUI)}, if the
 * text components current UI is not an instance of the given wrapper class.
 * 
 * @param textComponent
 * @return <code>true</code> if the UI has been replaced
 */
protected boolean replaceUIIfNeeded(JTextComponent textComponent) {
  if (wrapperClass.isAssignableFrom(textComponent.getUI().getClass())) {
    return false;
  }
  textComponent.setUI(wrapUI(textComponent));
  return true;
}

代码示例来源:origin: stackoverflow.com

@Override public void updateUI() {
 super.updateUI();
 setUI(MyPasswordFieldUI.createUI(this));

代码示例来源:origin: stackoverflow.com

ta.setLineWrap(true);
ta.setWrapStyleWord(true);
ta.setUI(new CustomTextAreaUI());
fr.add(new JScrollPane(ta));
fr.setSize(100,200);

代码示例来源:origin: stackoverflow.com

setUI(new HintTextFieldUI(hint, true));

相关文章

JTextComponent类方法