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

REGRESSION: Appletviewer does not repaint applets correctly when window is resized

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:

      Description

      FULL PRODUCT VERSION :
      Microsoft Windows XP [Version 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      C:\Documents and Settings\kerri>java -version
      java version "1.5.0_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)



      ADDITIONAL OS VERSION INFORMATION :
      Windows XP Professional

      A DESCRIPTION OF THE PROBLEM :
      When running an applet that has text in a rectangular box around it both without 2Dgraphics and with 2Dgraphics as soon as you resize the appletviewer window the output disappears but when you decrease the window size again by dragging the side the output reappears, increase size dissappears, decrease size reappears. As well, the background changes to a grey colour in the appletviewer window. When I run the same applets in IE6 and change the window size the applet output remains but the vertical scrollbar on the side of the window I drag to increase the window size seems to repeat in a trailing scrollbar pattern and sometimes there are multiple scrollbar graphics on the screen. The refresh or repaint does not seem to be working correctly.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run an applet in appletviewer then drag the right side of the window to enlarge it. Then drag it back to decrease window size.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The applet output to remain the same as when it was first rendered in the browser (appletviewer).
      ACTUAL -
      Changes to the output either not showing or reappearing.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;

      public class JBoxAround2 extends JApplet
      {
      String companyName = new String("Event Handlers Incorporated");
      Font serifItalic = new Font("Serif", Font.ITALIC, 20);
      int leading, ascent, height, width;
      int x = 40, y = 60;

      static final int BORDER = 5;

      public void paint(Graphics pen)
      {
      Graphics2D two = (Graphics2D)pen;
      two.setFont(serifItalic);
      two.drawString(companyName,x,y);
      leading = two.getFontMetrics().getLeading();
      ascent = two.getFontMetrics().getAscent();
      height = two.getFontMetrics().getHeight();
      width = two.getFontMetrics().stringWidth(companyName);

      two.drawRect(x - BORDER, y - (ascent + leading + BORDER), width + 2 * BORDER, height + 2 * BORDER);

      repaint();
      }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      none, use the previous version 1.4.2 because this problem also occurs in version 1.4.0
      Release Regression From : 1.4.2_09
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

        Attachments

          Activity

            People

            • Assignee:
              agerasimsunw Alexander Gerasimov (Inactive)
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: