Hi group,

I'm simply trying to do get the subject's matter running ... and fail. I 
googled 2 pieces for this and both don't work.


Using this:

var tableModel = new AbstractTableModel() {
     getRowCount: function() { return 2; },
     getColumnCount: function() { return 2; },
     getValueAt: function(row, column) {
         return "ABC";
     }
};
var jTable = new JTable(tableModel);


results in this:

Exception in thread "main" java.lang.AbstractMethodError: 
adapter1.getColumnCount()I
         at javax.swing.JTable.createDefaultColumnsFromModel(Unknown Source)
         at javax.swing.JTable.tableChanged(Unknown Source)
         at javax.swing.JTable.setModel(Unknown Source)
         at javax.swing.JTable.<init>(Unknown Source)
         at javax.swing.JTable.<init>(Unknown Source)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at org.mozilla.javascript.MemberBox.newInstance(MemberBox.java:184)
         at 
org.mozilla.javascript.NativeJavaClass.constructSpecific(NativeJavaClass.java:274)
         at 
org.mozilla.javascript.NativeJavaClass.construct(NativeJavaClass.java:193)
         at 
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3380)
         at
...

Same error also for:

var tableModel = new JavaAdapter(AbstractTableModel, {
     getRowCount: function() { return 2; },
     getColumnCount: function() { return 2; },
     getValueAt: function(row, column) {
         return "ABC";
     }
});
var jTable = new JTable(tableModel);


Any help is appreciated.

Thanks in advance, Frank


Btw.: thanks also for the great work with Rhino!
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to