⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myhtmleditorkit.java

📁 Vyger offers a D & D and Rogue-like environment in a graphical online roleplay game.
💻 JAVA
字号:
package wotlas.utils;

import javax.swing.text.html.*;
import javax.swing.text.*;

/**
 * see http://www.javaworld.com/javatips/javatip109/javatip109.zip
 */

public class MyHTMLEditorKit extends HTMLEditorKit
{

  /**
   */
  public ViewFactory getViewFactory() {
    return new HTMLFactoryX();
  }

  /**
   */
  public static class HTMLFactoryX extends HTMLFactory implements ViewFactory
  {
    
    public View create(Element elem) {
      Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
      if (o instanceof HTML.Tag) {
	      HTML.Tag kind = (HTML.Tag) o;
        if (kind == HTML.Tag.IMG) 
          return new MyImageView(elem);
      }
      return super.create( elem );
    }
  }
  
}










⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -