From 44c20b341296296d9dacfc2be32b556a7ecc9501 Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 26 Jul 2001 01:33:08 +0000 Subject: [PATCH] Rearrange code to prevent recursion if scrollRectToVisible() results in a call to doLayout() (which it seems to do in certain cases). git-svn-id: https://samskivert.googlecode.com/svn/trunk@215 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../robodj/src/java/robodj/chooser/PlaylistPanel.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java index 5bfac493..ecdbba10 100644 --- a/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java +++ b/projects/robodj/src/java/robodj/chooser/PlaylistPanel.java @@ -1,10 +1,9 @@ // -// $Id: PlaylistPanel.java,v 1.4 2001/07/26 01:18:49 mdb Exp $ +// $Id: PlaylistPanel.java,v 1.5 2001/07/26 01:33:08 mdb Exp $ package robodj.chooser; -import java.awt.Color; -import java.awt.Font; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; @@ -319,8 +318,11 @@ public class PlaylistPanel super.doLayout(); if (_target != null) { - scrollRectToVisible(_target.getBounds()); + Rectangle bounds = _target.getBounds(); _target = null; + // this seems to sometimes call layout(), so we need to + // prevent recursion + scrollRectToVisible(bounds); } }