Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4028562
Votes 2
Synopsis AWT need way to dynamically detect Frame resizing.
Category java:classes_awt
Reported Against 1.1beta3
Release Fixed
State 11-Closed, duplicate of 4077991, request for enhancement
Priority: 5-Very Low
Related Bugs 4077991
Submit Date 28-JAN-1997
Description




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.
======================================================================
Work Around




none that I can think of.
======================================================================
Evaluation
Developer wants to receive the Component.COMPONENT_RESIZED as the component is
being resized.
  xxxxx@xxxxx   1997-12-07
Comments
  
  Include a link with my name & email   

Submitted On 09-MAR-1999
kriff
For efficiency, I'd suggest that you create a new
event (perhaps called componentResizing) and an
appropriate listener interface class. This way,
current programs will not be affected and they 
will not be deluged with constant event notifications.



Submitted On 25-OCT-1999
xephyrus
This is NOT a request for enhancement - the resize notification DOES NOT WORK. 
There is absolutely no value in returning the size the component was - that is
a bug.  When notifying of a resize event, the size that the user is trying to
resize to is the significant data involved.  Otherwise it's just a tease:
"I'm resizing, but the new size is a Secret! Ha!"  Please consider
reclassifying this bug.


Submitted On 02-NOV-1999
gbv98
I see this is a duplicate of a bug I just submitted which was given bug number
4286216.
(Which is not yet in the external database).
See also bug number 4025609 which tells us that the Sun engineers are
deliberately surpressing these messages. 
The supression of these messages was completely pointless because of bug number
4174831 which caused multiple complete repaints of the frame during the resize
operation. Bug 4174831 has just been fixed in 1.3beta.
The resize/repaint policy is completely foul, I am going to submit other bugs
to point this out.
I have little hope of them ever being fixed. 
David Campaign



Submitted On 04-DEC-2001
wplaner
The requested behaviour can only be obtained by setting the 
JFrame NOT resizable and adding a MouseListener which 
performs the resizing when the Mouse-Pointer is dragged 
near the edges of the frame  



PLEASE NOTE: JDK6 is formerly known as Project Mustang