Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet acting strange under JRE 1.4x

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, but what's the solution?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic