BF [ 1891082 ] NPE on MiniTable when you hide some columns

This commit is contained in:
teo_sarca 2008-02-11 11:44:45 +00:00
parent 8340239975
commit 6216f2c06e
1 changed files with 7 additions and 2 deletions

View File

@ -44,6 +44,9 @@ import org.compiere.util.*;
* </code> * </code>
* @author Jorg Janke * @author Jorg Janke
* @version $Id: MiniTable.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $ * @version $Id: MiniTable.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1891082 ] NPE on MiniTable when you hide some columns
*/ */
public class MiniTable extends CTable public class MiniTable extends CTable
{ {
@ -117,9 +120,11 @@ public class MiniTable extends CTable
renderer = getCellRenderer(row, col); renderer = getCellRenderer(row, col);
comp = renderer.getTableCellRendererComponent comp = renderer.getTableCellRendererComponent
(this, getValueAt(row, col), false, false, row, col); (this, getValueAt(row, col), false, false, row, col);
if (comp != null) {
int rowWidth = comp.getPreferredSize().width + SLACK; int rowWidth = comp.getPreferredSize().width + SLACK;
width = Math.max(width, rowWidth); width = Math.max(width, rowWidth);
} }
}
// Width not greater .. // Width not greater ..
width = Math.min(MAXSIZE, width); width = Math.min(MAXSIZE, width);
tc.setPreferredWidth(width); tc.setPreferredWidth(width);