diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java index e1cddc1e2..0c4506930 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableCellRenderer.java @@ -142,7 +142,7 @@ public class SVTableCellRenderer extends JLabel Font font = new Font(f.getFontName(),fontstyle,f.getFontHeightInPoints()); setFont(font); - + HSSFColor clr = null; if (s.getFillPattern() == HSSFCellStyle.SOLID_FOREGROUND) { @@ -155,6 +155,11 @@ public class SVTableCellRenderer extends JLabel setBackground(awtcolor); + clr = (HSSFColor)colors.get(new Integer(f.getColor())); + if (clr == null) clr = new HSSFColor.BLACK(); + rgb = clr.getTriplet(); + awtcolor = new Color(rgb[0],rgb[1],rgb[2]); + setForeground(awtcolor); } diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java index 6cbce8000..ada60a840 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SVTableModel.java @@ -91,7 +91,7 @@ public class SVTableModel extends AbstractTableModel { public int getColumnCount() { - return this.maxcol; + return this.maxcol+1; } public Object getValueAt(int row, int col) { HSSFRow r = st.getRow(row); @@ -110,4 +110,4 @@ public class SVTableModel extends AbstractTableModel { } -} \ No newline at end of file +} diff --git a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java index 157d7f532..ba38f5ea6 100644 --- a/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java +++ b/src/contrib/src/org/apache/poi/hssf/contrib/view/SViewer.java @@ -109,6 +109,8 @@ public class SViewer extends Applet { boolean isurl = false; if (filename == null) filename = getParameter("filename"); + System.out.println("filename="+filename); + System.out.println("start="+filename.substring(0,7)); if (filename == null || filename.substring(0,7).equals("http://")) { isurl = true; if (filename == null) filename = getParameter("url");