使用 Jruby 并希望将 2d ruby 数组传递给 javax.swing.table.DefaultTableModel
#create a empty table view on UI and will fill out it later
columns = ['1','2']
data = [[]]
columns.length.times{ data.first << ""}
# below raise exception
mode = javax.swing.table.DefaultTableModel.new(data,columns)
似乎是方法签名匹配导致的异常,如何解决?
NameError: no constructorfor arguments (org.jruby.java.proxies.ArrayJavaProxy
,or g.jruby.RubyArray) on Java::JavaxSwingTable::DefaultTableModel
available overloads:
(java.util.Vector,java.util.Vector)
(java.lang.Object[],int)
(java.util.Vector,int)
(int,int)
(java.lang.Object[][],java.lang.Object[])