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

JDesktopPane and getGraphics() bug

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0_11"
      Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
      Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [version 5.1.2600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      XP SP3 Family, NVIDIA GeForce 7300 LE

      A DESCRIPTION OF THE PROBLEM :
      First, sorry for my english, I am french.

      when i using a JDesktopPane, if I call the method getGraphics() from a component linked with this (child or parent?), moving of internal frame will lag (only if setDragMode is defined to JDesktopPane.OUTLINE_DRAG_MODE).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See source code to reproduce this bug

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Moving the internal frame don't lagging
      ACTUAL -
      Moving the internal frame lagging

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error message

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.BorderLayout;

      import javax.swing.JDesktopPane;
      import javax.swing.JFrame;
      import javax.swing.JInternalFrame;
      import javax.swing.JPanel;


      public class BugTester
      {
      public static void main(String[] args) throws Throwable
      {
      // Creation of panel
      JPanel panel = new JPanel();

      // Creation of internal frame
      JInternalFrame internalFrame = new JInternalFrame("My child frame");
      internalFrame.getContentPane().add(panel, BorderLayout.CENTER);
      internalFrame.setVisible(true);
      internalFrame.setLocation(20, 20);
      internalFrame.setSize(300, 300);

      // Creation of desktop pane
      JDesktopPane destopPane = new JDesktopPane();
      destopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); // IMPORTANT !!!! don't bug if not defined
      destopPane.add(internalFrame);

      // We show internal frame
      internalFrame.setSelected(true);

      // Frame
      JFrame frame = new JFrame("JDesktopPane and getGraphics() bug tester");
      frame.setSize(500, 500);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setLocationRelativeTo(null);
      frame.setContentPane(destopPane);
      frame.setVisible(true);

      // Waiting 2000 ms
      System.out.println("Waiting 2000 ms...");
      Thread.sleep(2000);
      System.out.println("Wait OK ! Moving the internal frame must lag now...");

      // Getting graphic context from panel
      panel.getGraphics();
      }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      don't using getGraphics()

      Release Regression From : 6u6
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

            alexp Alexander Potochkin (Inactive)
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: