|Re: EOL - Native calls to static Java members? [message #774883 is a reply to message #774708]
||Wed, 04 January 2012 21:01
| EclipseUser Missing name
Registered: December 2011
I just came across another problem with boolean parameters when intializing an object with new Native(). For example when trying to initialize a Boolean from a EOL boolean we get the following:|
var test = new Native("java.lang.Boolean")(true)
Output: 'Native type java.lang.Boolean does not define a suitable constructor for arguments [true]'
For this example this can be circumvented by using a string parameter to construct the boolean (new Native("java.lang.Boolean")("true")), but there are instances in which we need to pass a primitive type boolean, such as here (to start a modal dialog):
var frame = new Native("javax.swing.JDialog")(new Native("java.awt.Frame"),true);
Output: 'Native type javax.swing.JDialog does not define a suitable constructor for arguments [java.awt.Frame[frame13,0,22,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=,resizable,normal], true]'
The EOL boolean can apparently not be used to initialize a Java object that expects a Java primitive boolean type. Is this a bug? Is there a way I can circumvent this?
[Updated on: Thu, 05 January 2012 02:34]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02308 seconds