Table of Contents

Manual for JWebEngine v1.08

1. Installation

Copy the JWebEngine.jar to the CLASSPATH of your application. That's all.

2. Using

JWebEngine can very easily be integrated into an existing application. If you want replace the default Java HTML editor with JWebEngine you just need to add the following lines to your application:

    static{
        // register JWebEngine for HTML content
        JEditorPane.registerEditorKitForContentType( "text/html", "com.inet.html.InetHtmlEditorKit" );
    }

The code has to be executed before you load the first HTML page.

If you would like to use an HTML-based Rich Text editor you may use the class com.inet.editor.BaseEditor. See the FileEditor sample for more details.

2.1 Applying a license key

To activate a license key for JWebEngine, simply put the license key file named license.txt into a package com.inet.html. This can be done either by adding the license key to the JWebEngine jar file or by adding the file to your application. However make sure to place the file into the correct package directory. If the activation was successful, the trial license water mark will disappear.

2.2 Enable spell checking

JWebEngine can be extended by the JOrtho spell checker. Simply add the JOrtho jar file and the required dictionaries to your class path. This will extend the base editor by a full featured spell checker. As a quick start you may as well download the JWebEngine / JOrtho bundle from our website. We recommend to check for the latest version of JOrtho and the dictionaries form time to time.

3. Samples

There are several samples bundled with JWebEngine. These samples are designed to show some entry points into using JWebEngine.

3.1 FileViewer

This sample shows how to use the JWebEngine as a text viewer.

3.2 FileEditor

This sample shows how to use the JWebEngine as a Rich Text editor. It uses the com.inet.editor.BaseEditor class, to easily create a fully featured text editor.

3.3 Hyperlink Handler Example

This sample demonstrates how to customize the handling of the com.inet.editor.BaseEditor on hyperlinks. This sample is based on the FileEditor.

3.4 RenderExample

Side-by-side render comparison of the Java HTML renderer and the JWebEngine.

3.5 Paged Printing

This sample shows how to render an HTML page into several page images. This is especially useful for printing or splitting large pages to avoid memory issues.

3.6 Loading of custom images

This sample shows how to display custom images which cannot be resolved by a normal URL. To do so this ImageView class has to be extended and the InetHtmlFactory has to be modified to provide the overwritten instance instead of a normal ImageView.

4. FAQ

What is JWebEngine?

JWebEngine is a 100% pure Java HTML 4 viewer and editor. It is fully compatible with any javax.swing.JEditorPane and javax.swing.JTextPane. It is based on the javax.swing.text.Document. You can use it together with third party components like the JOrtho spell checker.

What can I do with JWebEngine?

You can use JWebEngine as:

  • a formatted WYSIWYG text editor
  • an email viewer (JWebEngine passes the Acid mail test)
  • a viewer for help pages (JWebEngine is compatible with JavaHelp)
  • displaying HTML pages from the internet.

How can I get rid of the watermark?

This bundle is designed to give you the opportunity to evaluate JWebEngine without functional restrictions. To purchase a license and switch off the watermark plase contact sales@inetsoftware.de.

What are the advantages versus the built-in Java HTML editor?

The built-in Java HTML editor of Java is very limited. It only supports HTML 3.2 with some features of HTML 4 and CSS. The support of CSS is wrong in many cases, especially when it comes to cascading selectors. The text is often too small and on many web sites Java only shows an error instead of a incorrectly formatted page.

Here are some further differences:

  • JWebEngine can display the ACID 1 test correctly - Java does not
  • JWebEngine can display the ACID 2 test partly - Java only displays a blank page because an error occurs
  • JWebEngine basically shows HTML pages like a browser with JavaScript disabled
  • In cases where the CSS and HTML specifications are not explicit about implementation JWebEngine is designed to mirror Mozilla FireFox's behavior.

Why did you develop JWebEngine?

We developed JWebEngine for our ticket system i-net HelpDesk. The basic requirement was to create an editor and renderer for any type of HTML Mail as well as a browser for common web sites. Since our products are Java-based, the solution needed to be platform-independent. After JWebEngine proved itself useful in the ticket system we continued to integrate JWebEngine into further products. To give some examples: any help browser - including JavaHelp-based systems - in our products now uses JWebEngine. Our reporting solution now renders embedded HTML using JWebEngine. The possibility to completely embed and customize the renderer is a great advantage of JWebEngine.

Will the JWebEngine development be continued?

JWebEngine is a core component of many of our products. So we “eat our own dog food” and continually improve and enhance JWebEngine.

5. Changes

Version 1.08 (September 16, 2015)

  • Support for CSS attribute letter-spacing
  • Allowed HTML comments in style element
  • Support for non-URL windows pathes im image sources
  • Support for CSS length with missing unit identifier
  • Support for 2D CSS transformations
  • Support for letter spacing
  • Fix for pasting strings with a slash from a different Java VM
  • Fix for setting character attributes on nestes SPAN elements
  • Performance improvements

Version 1.07 (January 30, 2014)

  • Implementation of minHeight, maxHeight, minWidth and maxWidth
  • Search function improved
  • Fix for inconsistent COLSPAN and ROWSPAN attributes in tables
  • CSS whitespace 'preline' and 'prewrap' is now supported
  • Performance improved for repeated background-images
  • New Limitation for DOM deepth, this prevents errors for invalid or too complex HTML content
  • Fix for the image load timeout in paged rendering mode
  • StackOverflowException occurred if tables are corrupt
  • It was not possible to add text before and after a table that was pasted into the JWebEngine field
  • Permission attributes to the manifest added. These are required since Java 7u51.

Version 1.06 (February 21, 2012)

  • Enhanced table parser to handle invalid tables. NOTE: This will change the DOM in case there is an invalid table in a document!
  • Modified table layout algorithms for a better weighted distribution of cells
  • Fixed clipping of explicit borders on table cells
  • The inline-convesion can now resolve cached-only images as well
  • New samples for paged printing and custom images
  • Fix for system color borders which occurs in recent JRE versions
  • Optimization of the font selection combo box
  • Support for Java internal Clipboard objects
  • Fixed URL ref decoding bug, especially relevant for Windows pathes
  • Fixed that hidden element could intercept hyperlink events of visible elements at the same location

Version 1.05 (September 08, 2011)

  • Fixed visual representation of the numbers in an UL list
  • Fixed paste scenario with html fragment markers. JWebEngine will now only paste the frament content. This is especially relevant when copying from the Internet Explorer into JWebEngine
  • The system DPI value can not be set. This will override the operating system DPI value.
  • Copying images from JWebEngine into another application is now possible
  • Fixed Caret for Nimbus Look&Feel
  • JWebEngine now has an AsyncLoadPriority of 4 which causes a setPage call on a normal JEditorPage to load the new content in a separate thread. This behavior is similar to the default HTMLDocument.
  • Fixed CSS parser bug, which dropped subsequent @import expressions
  • Changed input(eg. Font-Family) attributes are now persistent over linebreaks as well when typing.
  • Data-URL (protocoll) implemented
  • Images which are only partially loaded yet, are now rendered with a transparent or white(depending on color model) background.

Version 1.04 (December 03, 2010)

  • CSS: support of relative height according to the CSS2.1 specification, including different rendering depending on the document type
  • Fix for GIF animations. GIF images were not animated due to the switch to an internal image fetcher and cache
  • New 'copy plain text' action - this is a workaround for Firefox, which doesn't accept the java HTML clipboard
  • The InetHtmlWriter can now be configured to write only the contents of a certain HTML element. In addition, the style base SPAN element (required on copy&paste) can be disabled.
  • A new TextLoadListener is available. This listener can be registered to the baseEditor to receive notification when the document has been completely loaded.
  • The BaseEditor toolbar now supports an simple customization by overwriting the addButtons method.
  • A search dialog is now available by default in the BaseEditor.
  • Fix for CSS selectors with |= and ~= as attribute checks
  • Painting to different graphics instances now checks for a change in the font metrics and readjusts the text layout accordingly. This enables you to print to the same TextPane to the screen and a printer for instance.
  • Handling for empty (null) clip area

Version 1.03 (July 12, 2010)

  • new Integrated and customizable full text search
  • enhanced JOrtho integration for the BaseEditor
  • updated the CSS inline converter to convert the image contents to embedded images
  • hyperlink clicks are now more tolerant if the moved is moved while clicking
  • Changed tab-stops(entered by the user) to 8 white spaces
  • Changed UL type square to not filled

Version 1.02 (April 21, 2010)

  • new Image cache: you can now edit the source code without loosing pasted images
  • Fix for table layouts in case there are more COL in a COLGROUP than columns in the table
  • corrected scaling for images if only height or width is set
  • new word break algorithm for Chinese, Korean and Japanese text

Version 1.01 (February 17, 2010)

  • New TextPane with the ability to set socket/connection timeouts
  • New Converter function to transform HTML with linked CSS content to inline-only styled HTML

Version 1.0 (February 09, 2010)

  • Added parser timeout which does not stop the rendering process

Version 1.0 (December 14, 2009)

  • First public version

6. Support

If you have any questions or problems, please do not hesitate to contact tools@inetsoftware.de for technical support. You can find more information on our website: http://www.inetsoftware.de/other-products/jwebengine.

Copyright 2006 - 2014, i-net software GmbH. All rights reserved.

 

© Copyright 1996 - 2024, i-net software; All Rights Reserved.