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
This commit is contained in:
@@ -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;
|
package robodj.chooser;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.*;
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -319,8 +318,11 @@ public class PlaylistPanel
|
|||||||
super.doLayout();
|
super.doLayout();
|
||||||
|
|
||||||
if (_target != null) {
|
if (_target != null) {
|
||||||
scrollRectToVisible(_target.getBounds());
|
Rectangle bounds = _target.getBounds();
|
||||||
_target = null;
|
_target = null;
|
||||||
|
// this seems to sometimes call layout(), so we need to
|
||||||
|
// prevent recursion
|
||||||
|
scrollRectToVisible(bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user