JDK-4413683 : Incorrect redrawing: bean disappears when resizing (in eg. Word97)
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-02-09
  • Updated: 2002-04-29
  • Resolved: 2002-04-29
Related Reports
Duplicate :  
Description

Name: boT120536			Date: 02/08/2001


Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

I’ve written the following simple bean to demo the problem:

package dk.hiq.umlwise.application;

import java.awt.*;
import java.io.*;

public class UMLDiagramBean
   extends java.awt.Component
{
   public UMLDiagramBean()
   {
   };
   public Dimension getPreferredSize()
   {
      return new Dimension(400, 300);
   };
  public void paint(Graphics g)
  {
     Dimension dim = getSize();
     if (g instanceof Graphics2D) {
        Graphics2D g2 =(Graphics2D)g;
        g2.setStroke(new BasicStroke(2));
     };
     g.setColor(Color.yellow);
     g.fillOval(1, 1, dim.width-2, dim.height-2);
     g.setColor(Color.blue);
     g.drawOval(1, 1, dim.width-2, dim.height-2);
  };
};

I compile the Bean using JDK 1.3.0-C (I’ve tried the 1.2.2 distributed along
with JBuilder too), and I register it as an ActiveX control using the Packager
class (also the one distributed with JDK 1.3.0-C).

Then I start Word97 (SR-2), add a little text and insert the bean. Then I
deselect the bean and select it again (necessary to get resize handles), and
resize the bean using the mouse.

The bean is gone! (that is, it doesn’t display anything).

If i double-click the invisible bean, it appears again – but the moment I
deselect it, it disappears again.

As an aside, if I now choose to print the document, the bean magically
reappears.

My diagnosis: the display cache provided by ActiveX isn’t used properly by the
ActiveX bridge during resize. When I print the document, an update of the cache
is forced, causing the symptoms to disappear.
(Review ID: 111658) 
======================================================================

Comments
WORK AROUND Name: boT120536 Date: 02/08/2001 I tried calling repaint() whenever my bean is resize, but it still doesn't work ======================================================================
11-06-2004

EVALUATION The Active-X Bridge was removed in Java 1.4.0 based on a Java Steering Committee decision nearly 2 years ago. The decision was based on 2 things. Customer interest was marginal at best and Java Plug-in was no longer dependent on the bridge technology to operate. It was necessary to remove it to allow for code refactoring and reworking in 1.4.0. Since removing the bridge, many customers have expressed interest in it. We have filed an RFE (4616580) for this support in a future release. We are currently evaluating whether we have a significant business case to justify the 1-3 man-month engineering effort (more for supporting teams) in the Mantis/Tiger timeframe. NOTE: Mantis = Java 1.4.2 FCS Q2, 2003 Tiger = Java 1.5 FCS Q4, 2003 Support for the bridge in existing 1.3.x releases is limited to escalations and can be persued with our CTE team. This bug will be closed as a duplicate of 4616580. ###@###.### 2002-04-29
29-04-2002