summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2005-11-15 23:07:23 +0000
committerRoman Kennke <roman@kennke.org>2005-11-15 23:07:23 +0000
commitd00f2efeb82e4d50c7923a6c2c8e9ebf1a9fe154 (patch)
tree91ed8d6743ed411fc619bc5deb96c8ff1c82c154
parent8e2bf2c8909f8129c422c1066fb0f3b44d5cfe35 (diff)
downloadclasspath-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--ChangeLog7
-rw-r--r--javax/swing/JComponent.java12
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b804f2bc6..7de0a061b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);