JDK-4233811 : JEditorPane, HTMLEditorKit and ImageView - how to get the Image-Object
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_98
  • CPU: x86
  • Submitted: 1999-04-28
  • Updated: 2002-03-07
  • Resolved: 2000-03-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
1.4.0 betaFixed

Name: vi73552			Date: 04/28/99

I don't know, if my problem is a bug or a feature, or both?

I tried to get an Image from an loaded HTML-Site via HTMLEditorKit.setPage(URl url).

I found, that the class ImageView loads the Image from the URL. ImageView is created by the Method HTMLEditorKit.HTMLFactory.create(Element elem)...
( But all that you know too (or better :) ))

ImageView is a package-class, and has no method, to get the downloaded Image! that is more a feature problem than a bug.
->What about -making the class ImageView public (why is this class package (InlineView, ListView ... are public too!)
->           -adding a method to ImageView to return the Image 

In the class ImageView is a property called 
    static final String IMAGE_CACHE_PROPERTY = "imageCache";
but this property isn't yet used. (I don't know, but the cache would be the right place for getting the Images)

The third:
Is it possible to create a method in HTMLEditorKit, to abort the loading of a WebPage? (and still viewing the page with the Images, which are already loaded);

I only used the swing-version of jdk1.2 (the java-doc too)
but in the on-line version of the documentation swing1.1.1 (eary access) the class ImageView was still a package class.

In the class HTMLEditorKit.HTMLFactory in the javadoc-document is a table, which view is used for the tags (The table is one line! ->the writer forgotten some tags)
For Tag.IMG is the view ImageView - that is correct. But because the ImageView-class is package, there is no documentation for this class available - there is no way to find Information for the ImageView class (the souce-code, but ...)
(Review ID: 57116) 

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta

WORK AROUND Name: vi73552 Date: 04/28/99 There is a way ... (or more ways) but it is very long. I copied the source-Code of HTMLEditorKit. My new class extends the HTMLEditorKit. I changed the method in the subclass HTMLEditorKit.HTMLFactory by returning not an new ImageView(Element elem)but my class MyImageView. this class has a method called public Image getImage() :) ======================================================================

EVALUATION ImageView has been rewritten and will be public. The methods that are public/protected are now: public String getAltText() { public URL getImageURL() { public Icon getNoImageIcon() { public Icon getLoadingImageIcon() { public Image getImage() { public void setLoadsSynchronously(boolean newValue) { public boolean getLoadsSynchronously() { protected StyleSheet getStyleSheet() { protected void setPropertiesFromAttributes() { scott.violet@eng 2000-02-28