Use the right way to figure out how many rows on a sheet, so we display the row number for all of them on the left hand side. Also, tidy up some imports

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@629742 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2008-02-21 10:49:25 +00:00
parent 528bda2729
commit 8862ef22aa
5 changed files with 3 additions and 15 deletions

View File

@ -21,11 +21,8 @@
package org.apache.poi.hssf.contrib.view; package org.apache.poi.hssf.contrib.view;
import java.awt.*; import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.table.*; import javax.swing.table.*;
import javax.swing.event.*;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
@ -47,7 +44,9 @@ public class SVRowHeader extends JList {
this.sheet = sheet; this.sheet = sheet;
} }
public int getSize() { return sheet.getPhysicalNumberOfRows(); } public int getSize() {
return sheet.getLastRowNum() + 1;
}
public Object getElementAt(int index) { public Object getElementAt(int index) {
return Integer.toString(index+1); return Integer.toString(index+1);
} }

View File

@ -20,11 +20,9 @@ package org.apache.poi.hssf.contrib.view;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.text.*;
import java.util.*; import java.util.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*; import javax.swing.table.*;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;

View File

@ -19,8 +19,6 @@
package org.apache.poi.hssf.contrib.view; package org.apache.poi.hssf.contrib.view;
import java.util.Hashtable;
import javax.swing.*; import javax.swing.*;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import javax.swing.border.*; import javax.swing.border.*;
@ -28,14 +26,11 @@ import javax.swing.border.*;
import java.awt.Component; import java.awt.Component;
import java.awt.Color; import java.awt.Color;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Font;
import java.io.Serializable; import java.io.Serializable;
import java.text.*; import java.text.*;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
/** /**

View File

@ -23,13 +23,10 @@ package org.apache.poi.hssf.contrib.view;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.net.*; import java.net.*;
import java.applet.*;
import java.io.*; import java.io.*;
import javax.swing.*; import javax.swing.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFCell;
/** /**
* Sheet Viewer - Views XLS files via HSSF. Can be used as an applet with * Sheet Viewer - Views XLS files via HSSF. Can be used as an applet with

View File

@ -25,7 +25,6 @@ import java.awt.event.*;
import java.io.*; import java.io.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.table.*; import javax.swing.table.*;
import javax.swing.event.*;
import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.usermodel.*;