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

AWT need way to dynamically detect Frame resizing.

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.1
    • client-libs
    • None
    • x86
    • windows_nt



      Name: mc57594 Date: 01/28/97


      I'm in the middle of writing a java source code editor in
      java. The TextArea component is not applicable as it does not support
      syntax coloring etc.
      I need a way to repair the drawing surface and reposition other
      components as the user resizes the frame. Currently the
      Component.COMPONENT_RESIZED event only occurs when the user has finished
      the resize operation. The current situation is not something you would
      want to give to the public. During a resize the document and associated
      components (scrollbars etc) hang where they were. The exposed areas of
      the Frame are now blank. When the user releases the mouse button
      everthing snaps back into place. The fiction that the user is viewing a
      seemless document is completely lost.
      I have tried a number of workarounds:
      1. During the resize operation getSize() retains its old value - its new
      value is not set until the end of the operation. Dead end.
      2. Frame.paint() is called during an sizing increase. In this case
      getGraphics().getWidth/getHeight() do return the instantaneous size of
      the Frame. Halleluya! However, paint() methods are not called for a
      decrease in size as no paint repairs are necessary(bummer!).

      What is needed is possibly an expansion of the WindowListener interface
      to include WindowResizing(WindowEvent) or that the COMPONENT_RESIZED be
      called more frequently during a resize.
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: