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

Graphics.drawLine not paint()ed in Applet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 6
    • 6
    • client-libs
    • x86
    • windows_2000



        Name: jk109818 Date: 10/15/2002


        FULL PRODUCT VERSION :
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
        Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

        AND

        java version "1.4.1"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
        Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

        FULL OPERATING SYSTEM VERSION :
        Microsoft Windows 2000 [Version 5.00.2195]
        Windows 2000 Service Pack 3

        A DESCRIPTION OF THE PROBLEM :
        When calling Graphics.drawLine last from Applet.paint, the
        line does not appear. Events that force the Applet to be
        repaint()ed cause the line to show. If the call to
        drawLine occurs before other calls (drawString,
        drawRoundRect) the line is correctly painted. If the
        drawLine call is last or followed only by calls to drawLine
        the line(s) are not drawn.

        REGRESSION. Last worked in version 1.3.1

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Create an Applet in which the paint() method contains
        only one call, a call to g.drawLine(30, 40, 105, 40).
        2. Run the Applet in the appletviewer.


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        The applet window appears blank. I expected to see one
        line running horizontally across the window. After
        dragging the mouse across the window, the window is repaint
        ()ed and appears as expected.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        /*
        <applet code = "DoesNotDrawLine.class" width = 275 height = 200>
        </applet>
        */

        import java.applet.Applet;
        import java.awt.Graphics;

        public class DoesNotDrawLine extends Applet {
          public void paint(Graphics g) {
            g.drawLine(30, 35, 105, 35);
          }
        }
        ---------- END SOURCE ----------

        CUSTOMER WORKAROUND :
        Add a call to g.drawString("", 0, 0) as the last method
        call in Applet.paint.
        (Review ID: 165763)
        ======================================================================

              dav Andrei Dmitriev (Inactive)
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: