I use Swing from JRuby and I am trying to set up a JTable with a TableModel as input.
table_headers looks something like this: ["bla", "narf", "poit"]
table_data looks something like this: [["one", "two"], ["test, test"], ["hello", "world"]]
my_model = javax.swing.table.DefaultTableModel.new(table_data,table_headers)
results in
C:/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in `new': no constructor with arguments matching [class org.jruby.RubyArray, class org.jruby.RubyArray] on object (NameError)
my_model = javax.swing.table.DefaultTableModel.new(table_data.to_java,table_headers.to_java)
results in
C:/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:no constructor with arguments matching [class org.jruby.java.proxies.ArrayJavaProxy, class org.jruby.java.proxies.ArrayJavaProxy] on object (NameError)
Any idea how to solve this?
Also: Isn't there an "easy" way to simple create a table and set the fields?
(e.g. something along the lines of:
bla = SomeTable.new(5,5)
bla[2][1] = "edited"
)
p.s. as you might see from the errormessage, I have to use windows