Small query on using Native [message #563879] |
Wed, 14 January 2009 10:55 |
No real name Messages: 92 Registered: July 2009 |
Member |
|
|
Hia again,
I've found it very handy to create native Java objects using from Epsilon,
e.g., var x := new Native('javax.swing.JFrame'); . Out of interest, is it
possible to call static Java methods from Epsilon -- e.g., if you want a
java.util.Calendar object, you can use java.util.Calendar.getInstance();
and I'm not sure how to invoke this from Epsilon.
Also, I noticed that Native takes as parameter a String, e.g., new
Native('blah'). Is it possible to invoke Java constructors/methods that
accept as parameter existing Epsilon object references? E.g.,
var x : String := 'My JFrame Title';
var frame := new Native('javax.swing.JFrame', x); -- where x is passed as
the first parameter to the JFrame constructor.
(On a side note, I stumbled into the above ponderings when I was doing
some String manipulation in Epsilon, and was looking for an Epsilon String
operation (table 4.2 in the epsilon book) which found the length of a
String (I couldn't find this in the manual) -- instead I defined an ugly
implementation of it using the existing substring methods and charAt).
Thanks in advance,
Edd
|
|
|
Powered by
FUDForum. Page generated in 0.04926 seconds