diff options
author | Roman Kennke <roman@kennke.org> | 2005-11-15 23:07:23 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2005-11-15 23:07:23 +0000 |
commit | d00f2efeb82e4d50c7923a6c2c8e9ebf1a9fe154 (patch) | |
tree | 91ed8d6743ed411fc619bc5deb96c8ff1c82c154 | |
parent | 8e2bf2c8909f8129c422c1066fb0f3b44d5cfe35 (diff) | |
download | classpath-d00f2efeb82e4d50c7923a6c2c8e9ebf1a9fe154.tar.gz |
2005-11-15 Roman Kennke <kennke@aicas.com>
* javax/swing/JComponent.java
(paintDoubleBuffered): Put paint() call inside a try-finally
block to correctly recover the double-buffering flag when
an exception is thrown inside the paint() call.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | javax/swing/JComponent.java | 12 |
2 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2005-11-15 Roman Kennke <kennke@aicas.com> + + * javax/swing/JComponent.java + (paintDoubleBuffered): Put paint() call inside a try-finally + block to correctly recover the double-buffering flag when + an exception is thrown inside the paint() call. + 2005-11-15 Lillian Angel <langel@redhat.com> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c diff --git a/javax/swing/JComponent.java b/javax/swing/JComponent.java index 37cf51835..deb08c5db 100644 --- a/javax/swing/JComponent.java +++ b/javax/swing/JComponent.java @@ -1918,9 +1918,15 @@ public abstract class JComponent extends Container implements Serializable g2 = getComponentGraphics(g2); g2.setClip(r.x, r.y, r.width, r.height); isPaintingDoubleBuffered = true; - paint(g2); - isPaintingDoubleBuffered = false; - g2.dispose(); + try + { + paint(g2); + } + finally + { + isPaintingDoubleBuffered = false; + g2.dispose(); + } // Paint the buffer contents on screen. g.drawImage(buffer, 0, 0, this); |