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

Frame.setBounds causes Frame.repaint to fail until PaintEvent.PAINT dispatched

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta
    • sparc
    • solaris_7
    • Verified

      I have attached a simple test case of this. It consists of a frame with two buttons and a subclass of Component. One button can be clicked to move the frame (setBounds), and the other will invoke repaint on the Frame to cause the Component to repaint. The Component displays an integer that is incremented everytime it is messaged with paint. If you click on the repaint button you can see that the Component updates its display. If you click on the move button, then the repaint button you'll notice that the repaints stop happening. Further, update/paint is never invoked on the Frame, which is why the Component is never messaged to paint. You can cause the repainting to occur again by obscuring the Window, or clicking on another Window and then back on the java Frame, then the repainting will work again.

      This is with 1.4beta-B43.

      I tracked this down a little, and it appears that MComponentPeer is assuming PaintEvent.PAINT will be dispatched after setBounds is invoked, which doesn't appear to be the case if the size of the Component doesn't change in setBounds. This change appears to have been introduced in 1.143 of MComponentPeer.

            ssisunw Ssi Ssi (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: