So, I've been delving into JRuby this week just for fun, and I'm working on using SWT to create some pretty stuffs. Long story short, I grab a value from a List and it ends up as what I've deduced to be a Java String Array. Like this:
java.lang.String[asdf]@52e50599
I need to be able to get this into a standard Ruby string, but I can't for the life of me figure out how to actually get the String (asdf) out of the string array using Java methods or JRuby methods.
EDIT:
Here is the snippet of code that grabs the string above
list is a Swt::Widgets::List JRuby object
button is a Swt::Widgets::Button JRuby object
button.add_selection_listener do
name = list.get_selection
end
Name ends up as the java.lang.String object
EDIT 2:
I'm certain I'm looking for the inverse of this:
EDIT 3:
This question is a duplicate of: Java Array in Jruby