This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, I wrote an Applet that uses Swing and acts as a permissions utility for our company's backend. Basically, it's a JTable with it's cells overloaded to show JCheckBoxes. I developed it using JRE 1.3.1_06, however when I run it on machines that have JRE 1.4x, I get StackOverflowException. Never got this error under JRE 1.3.1_06. Isn't JRE versions in Java downward compatible so that if I run an Applet under older version it should run under new version as well? Exception: ---------------------------------------- StackOverFlowException: AttributiveCellTableModel.setDataVector(AttributiveCellTableModel.java:42) AttributiveCellTableModel.setDataVector(AttributiveCellTableModel.java:43) ---------------------------------------- Here is part of code: --------------------- import java.util.*; import java.awt.*; import javax.swing.*; import javax.swing.table.*; import javax.swing.event.*; public class AttributiveCellTableModel extends DefaultTableModel { protected CellAttribute cellAtt; public AttributiveCellTableModel() { this((Vector)null, 0); } public AttributiveCellTableModel(int numRows, int numColumns) { Vector names = new Vector(numColumns); names.setSize(numColumns); setColumnIdentifiers(names); dataVector = new Vector(); setNumRows(numRows); cellAtt = new DefaultCellAttribute(numRows,numColumns); } public AttributiveCellTableModel(Vector columnNames, int numRows) { setColumnIdentifiers(columnNames); dataVector = new Vector(); setNumRows(numRows); cellAtt = new DefaultCellAttribute(numRows,columnNames.size()); } public AttributiveCellTableModel(Object[] columnNames, int numRows) { this(convertToVector(columnNames), numRows); } public AttributiveCellTableModel(Vector data, Vector columnNames) { setDataVector(data, columnNames); } public AttributiveCellTableModel(Object[][] data, Object[] columnNames) { setDataVector(data, columnNames); }
public void setDataVector(Vector newData, Vector columnNames) { if (newData == null) throw new IllegalArgumentException("setDataVector() - Null parameter"); dataVector = new Vector(); <---- line 42 setColumnIdentifiers(columnNames); <---- line 43 dataVector = newData; // cellAtt = new DefaultCellAttribute(dataVector.size(), columnIdentifiers.size()); newRowsAdded(new TableModelEvent(this, 0, getRowCount()-1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT)); } --------------------- thanks, Alex
All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson