Subj : Re: rhino java.awt.Color Problem!! To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Sat Sep 04 2004 06:24 pm Danilo wrote: > Hi, > i use rhino in my java software but i have this problem when i use this > code: > > var c = new java.awt.Color(123,34,45) > > generate thi error: > > WrappedException of Color parameter outside of expected range: Red Green > Blue > > the range is correct!! > why this error? java.awt.Color has 2 3-arg constructors, Color(int,int,int) and Color(float,float,float). According to LiveConnect specs, http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html , the second should be selected since conversion from JS number to Java float is more preferable then conversion to Java int. To workaround the problem you can specify explicitly which constructor to use: var c = new java.awt.Color['(int,int,int)'](123,34,45) Regards, Igor .