JSpinner cannot accept Fixnum for it's value
--------------------------------------------

                 Key: JRUBY-2872
                 URL: http://jira.codehaus.org/browse/JRUBY-2872
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
            Reporter: Logan Barnett
             Fix For: JRuby 1.1.4


{noformat} 
spinner = Java::javax::swing::JSpinner.new
spinner.value = 0
{noformat}

This code produces this error:
{noformat} 
java.lang.IllegalArgumentException: illegal value
        at javax.swing.SpinnerNumberModel.setValue(SpinnerNumberModel.java:426)
        at javax.swing.JSpinner.setValue(JSpinner.java:321)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:292)
        at org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:253)
        at 
org.jruby.javasupport.methods.InstanceMethodInvoker.call(InstanceMethodInvoker.java:45)
        at 
org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:64)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:147)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:384)
        at ruby.Users.logan.dev.jruby.int_type_test.__file__(int_type_test.rb:2)
        at ruby.Users.logan.dev.jruby.int_type_test.__file__(int_type_test.rb)
        at ruby.Users.logan.dev.jruby.int_type_test.load(int_type_test.rb)
        at org.jruby.Ruby.runScript(Ruby.java:542)
        at org.jruby.Ruby.runNormally(Ruby.java:455)
        at org.jruby.Ruby.runFromMain(Ruby.java:328)
        at org.jruby.Main.run(Main.java:194)
        at org.jruby.Main.run(Main.java:91)
        at org.jruby.Main.main(Main.java:82)
{noformat} 

Here's the JavaDoc for the JSpinner value= method:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JSpinner.html#setValue(java.lang.Object)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to