JDK-4623342 : InlineView causes extra spacing around images in JTable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_2000
  • CPU: generic,x86
  • Submitted: 2002-01-14
  • Updated: 2003-07-26
  • Resolved: 2003-07-26
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.
Other
5.0 tigerFixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
Save the attachments and compile and run EditorPaneTest.java. The editor pane loads an html document containing a table where each cell contains only a single image. There should be no spacing around the images and they should bump up against each other. Notice that this is not the case. There is spacing around the images. Web sites will often use tables to organize images like this and this bug makes them look really horrible.

The problem is a result of the newline characters that we generate to separate elements. These newline characters are then modeled by an InlineView which is contained in the same ParagraphView.Row that holds the ImageView. Due to the way that these views are layed out int the row, we end up with extra space around the image.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b13
14-06-2004

EVALUATION Name: dsR10138 Date: 06/11/2003 Extra spacing around images in table appears because of a newline character added to each table cell. Besides, when there is no image found a 1 pixel margin is added around each image which is incorrect. The idea of the fix is to mark an implied newline added to each paragraph with an attribute "CR" and return 0 as preferred span in such a case. ###@###.### 2003-06-09 ======================================================================
09-06-2003

WORK AROUND We can create custom version of inlinveView which has preferredSpan 0 in case it contains only '\n' Take a look at the attached FixedHTMLEditorKit.java To enabel that fixed editor kit call JEditorPane.registerEditorKitForContentType("text/html", "FixedHTMLEditorKit"); before using JEditorPane ###@###.### 2002-01-16
16-01-2002