-
Enhancement
-
Resolution: Fixed
-
P4
-
1.1.4, 1.2.0, 1.3.0, 1.3.1_04, 1.4.0
-
05
-
x86, sparc
-
generic, solaris_2.5.1, windows_nt, windows_2000
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2118972 | 1.4.1 | Btplusnull User | P4 | Resolved | Fixed | beta |
JDK-2118971 | 1.4.0_02 | Btplusnull User | P4 | Resolved | Fixed | 02 |
Name: rm29839 Date: 12/03/97
Hi!
When enable()/disable() of most AWT components is
called [ex: Button, TextField, etc] - they are doing
repaint(). They blink becouse of it.
[repaint() at the start probably clears whole
components area].
Example - when calling Button's disable() method -
text of Button nicely changes to gray ...and
WHOLE Button's area is repainted! Although nothing
changed there and nothing need to be repainted!
Becouse of it - application, which enables/disables
components alot (on Containers, which are shown) looks a bit odd.
It would be great if enable()/disable() of AWT components
will not call repaint() in this way.
[maybe call something like update()
which will paint ONLY changed parts. For example
to disable Button - it need only to paint gray
text over current text, and there is no need to clear
nothing at all.]
Thanks! 8-)
---
- leon
(Review ID: 21207)
======================================================================
Name: skT88420 Date: 06/17/99
When issuing a setEnabled() call on any component the
entire component is repainted. For smaller components like
a JTextField and JMenuItem this is annoying. For larger
components like JFrame or JDialog the blink caused by
the repaint makes the application completely unacceptable
to our user group.
An analysis of the Java source reveals that in fact every
component is repainted on a enable/disable:
Taken from awt_component.cpp:
JNIEXPORT void JNICALL
Java_sun_awt_windows_WComponentPeer_enable(JNIEnv *env, jobject self)
{
jint pData;
JNI_CHECK_PEER_RETURN(self);
AwtComponent* p = (AwtComponent*)pData;
::EnableWindow(p->GetHWnd(), TRUE);
::InvalidateRect(p->GetHWnd(), NULL, TRUE); // Bug #4038881 Labels don't enable and disable properly
CriticalSection::Lock l(p->GetLock());
p->VerifyState();
}
The InvalidateRect call was apparently added because of a
bug in labels. The side effect is that instead of
only repainting labels everything is being repainted.
For some reason you have had difficulty reproducing this
bug because it has been reported several times before:
4145715, 4024346, 4096745
Please make every effort to reproduce this bug, it is
critical that we have it fixed as we see no workaround.
I would be happy to suggest a fix, fly out and fix it,
in general do anything to see that it be fixed.
(Review ID: 84484)
======================================================================
- backported by
-
JDK-2118971 disable()/enable() make AWT [lightweight] components blink
- Resolved
-
JDK-2118972 disable()/enable() make AWT [lightweight] components blink
- Resolved
- duplicates
-
JDK-4407186 Enabling a JFrame causes complete repaint/flash using Windows
- Closed
-
JDK-4673900 Switching between panels leaves the old panel displayed the new one.
- Closed
-
JDK-4684354 JFrame/JDialog on WIndows flickers severely when setEnabled()
- Closed