Package javax.swing.text.html

Examples of javax.swing.text.html.HTMLEditorKit


    public DcMultiLineToolTipUI() {
        super();
        if (textPane == null) {
            textPane = ComponentFactory.getTextPane();
            textPane.setDocument(new HTMLDocument());
            textPane.setEditorKit(new HTMLEditorKit());
        }
    }
View Full Code Here


   
    private void setHtmlText(String text) {
        String s = getHtmlText(text);
       
        HTMLDocument document = (HTMLDocument) textPane.getDocument();
        HTMLEditorKit kit = (HTMLEditorKit) textPane.getEditorKit();
       
        try {
            textPane.setText("");
            kit.insertHTML(document, 0, s, 0, 0, null);
        } catch (Exception e) {
            logger.error("Could not insert html into the html document", e);
        }
    }
View Full Code Here

    contentpane = new JPanel();
    contentpane.setLayout(new VerticalLayout());

    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new HTMLEditorKit());
    helpPane.setPreferredSize(new Dimension(600, 100));
   
    final JPanel toolbar = new JPanel();
    toolbar.setLayout(new BorderLayout());
    toolbar.add(new JScrollPane(helpPane));
View Full Code Here

    BLOCK_ELEMENTS = Collections.unmodifiableSet(blockElements);
  }

  public HtmlRichTextConverter()
  {
    editorKit = new HTMLEditorKit();
  }
View Full Code Here

     */
    private void initialize(String help) {
        this.setLayout(new GridBagLayout());
        interfacePanel = new JPanel(new GridBagLayout());
        if (help != null) {
            HTMLEditorKit hek = new HTMLEditorKit();
            helpPanel = new JEditorPane();
            helpPanel.setEditable(false);
            helpPanel.setEditorKit(hek);
            try {
                InputStream helpStream = getHelp(help);
                if (helpStream != null) {
                    hek.read(new InputStreamReader(helpStream), helpPanel
                            .getDocument(), 0);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
View Full Code Here

        contentPane.setLayout( new BorderLayout() );

        JEditorPane htmlPane = new JEditorPane();
        htmlPane.setEditable(false);
        htmlPane.setContentType("text/html");
        htmlPane.setEditorKit( new HTMLEditorKit() );
        htmlPane.setBorder(new LineBorder(Color.black));
        htmlPane.addHyperlinkListener(this);
        htmlPane.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                AboutWindow.this.setVisible(false);
View Full Code Here

        tree.addTreeSelectionListener(this);

        htmlPane = new JEditorPane();
        htmlPane.setEditable(false);
        htmlPane.setContentType("text/html");
        htmlPane.setEditorKit( new HTMLEditorKit() );
        htmlPane.setBorder(new EmptyBorder(5, 5, 5, 5));

        JSplitPane splitPane = new ProportionalSplitPane(JSplitPane.HORIZONTAL_SPLIT);
        splitPane.setResizeWeight(0.0d);
        splitPane.setBorder(null);
View Full Code Here

    /**
     * Parses this document.
     */
    public void parse() throws IOException {
      HTMLEditorKit html = new HTMLEditorKit();
      Reader urlReader = null;
      try {
        urlReader = new InputStreamReader(getBase().openStream(), "ISO-8859-1");
        // Parse HTML file first without ignoring charset directive
        putProperty("IgnoreCharsetDirective", Boolean.FALSE);
        try {
          html.read(urlReader, this, 0);
        } catch (ChangedCharSetException ex) {
          // Retrieve document real encoding
          String mimeType = ex.getCharSetSpec();
          String encoding = mimeType.substring(mimeType.indexOf("=") + 1).trim();
          // Restart reading document with its real encoding
          urlReader.close();
          urlReader = new InputStreamReader(getBase().openStream(), encoding);
          putProperty("IgnoreCharsetDirective", Boolean.TRUE);
          html.read(urlReader, this, 0);
        }
      } catch (BadLocationException ex) {
      } finally {
        if (urlReader != null) {
          try {
View Full Code Here

                super.paint(g);
            }
        };
        htmlPane.setEditable(false);
        htmlPane.setContentType("text/html");
        htmlPane.setEditorKit( new HTMLEditorKit() );
        htmlPane.setBorder(null);
        htmlPane.addHyperlinkListener(this);

        try {
            URL welcomeUrl = ResourceManager.getWelcomeUrl();
View Full Code Here

  /**
   * Creates a <code>EditorPaneLinkDetector</code>.
   */
  public EditorPaneLinkDetector() {

    HTMLEditorKit htmlkit = new HTMLEditorKit();

    StyleSheet styles = htmlkit.getStyleSheet();
    StyleSheet ss = new StyleSheet();

    ss.addStyleSheet(styles);

    ss.addRule("body {font-family:arial;font-size:12pt}");
View Full Code Here

TOP

Related Classes of javax.swing.text.html.HTMLEditorKit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.