[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

· Java Applets in Delphi

Is there a way to use a java applet in a delphi
program ? as if it was a component or some other way.
0
bryan7
Asked:
bryan7
  • 6
  • 5
1 Solution
 
dwwangCommented:
Inprise said that maybe Delphi 5 can compile VCL source code into Java applet, that's already very exiting, but seems far from what you need.^_^
0
 
ThaddyCommented:
Yes, you can, at least sort of.
What you need is microsofts scripting ocx(msscript.ocx) and at least the ms javascript dlls
(www.microsoft.com/scripting).

Here's some basic code on how to use this:

procedure Tform1.runscript;
var
  script:iscriptcontrol;
begin
  Script:=CreateComObject(class_scriptcontrol) as iscriptcontrol;
  Script.SitehWnd:=self.handle;
  Script.Language:='JScript';
  Script.AddCode(widestring(Richedit1.lines.text));
  Script.run;
end;

If you need to script DELPHI itself, I can recommend the scripting engine by dreamcompany, its even better and you can script DELPHI functions from within Javascript.
www.dreamcompany.com.

0
 
ThaddyCommented:
Oh, I forgot to mention, that you can register your own automation serverobjects( written in delphi, ofcourse) to the scripting engine, so you can script them from javascript as well.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bryan7Author Commented:
.. I went to the page, but I'm totally lost there,,,


0
 
ThaddyCommented:
Goto 'scriptcontrol' (In de left pain)
Fill in the form, and you'll get it.
It's free by the way. And free to distribute provided a mention in your programs aboutbox and a bit of other legal stuff.
If you don't have ie4 then you must download the scripting engine as well, (Under 'Jscript', then 'Download') version 3.1!
version 5 is a bit buggy.
0
 
bryan7Author Commented:
??, why do I need IE4 ?

0
 
bryan7Author Commented:
now I see why.

0
 
bryan7Author Commented:
Ok, I have msscript.ocx.

how do I use the code you wrote ?

0
 
ThaddyCommented:
First, make shure the ocx is registered.
Then, create a form with a richedit or memo control.
You should be able to use the code I provided rightaway.
Write some Java code in the memocontrol, hit button to execute the code. I have more advanced code, just email me for a more elaborate example thaddy@cyco.nl
0
 
bryan7Author Commented:
Thaddy: I emailed you a week ago, and still have no response.
Did u get my email ?

bryan

0
 
ThaddyCommented:
Ok, 10 seconds to close down and counting....
9
8
7
6
5
4
3
2
1
go!

0
 
bryan7Author Commented:
gone !
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now