Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4413683

Incorrect redrawing: bean disappears when resizing (in eg. Word97)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • deploy
    • x86
    • windows_nt



      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)
      ======================================================================

            jmelvin James Melvin (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: