Results 1 to 6 of 6

Thread: Combining Java with VB

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Posts
    37
    Hi. Is there any way I can make a java applet load on a VB ActiveX control - designtime XOR Runtime?

    Thanks.
    Code:
    Dim yosef as Programmer
    more.list.AddItem "Java", vbMore
    yosef.AddList("VB", "C++", "Pascal", more.list)

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    266
    No it is not directly possible to load a Java applet on an Activex control. the applet needs to run in the VM which is available in the web browser. As of now I have not heard on any ActiveX that hosts a Java applet. The only way you can do this is by invoking the web browser from your application with an HTML page that loads the applet. By the way why do you want to load a Java applet from a VB application.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2000
    Posts
    37
    Actually, you can call an applet from VB by getting the applet object ---> applet = GetObject("java:package.AppletClass") and then use it's "show" method. I tried it, it works, it's closer to what I need then invoking a browser, but it's still not it.

    What I'm doing is: I have a part of the application that must call another application, written in jave (actually, an applet). now, I want to make the applet run inside the VB application window.

    A thought: maybe I can somehow set the parent hWnd of the applet to be the hWnd of some activeX control?
    Code:
    Dim yosef as Programmer
    more.list.AddItem "Java", vbMore
    yosef.AddList("VB", "C++", "Pascal", more.list)

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    266
    Dear yosef,
    Well I never knew you could invoke an applet using the GetObject("javaackage.AppletClass") .Well is it VJ++ ur talking about or pure Java. In pure Java as far as I know the design of an applet is such that it runs in a sandbox i.e the Virtual Machine. Virtual Machines are available in web browsers or through the appletviewer. I don't realy know how an applet can run outside the context of the VM.

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2000
    Posts
    37
    It's pure java.

    I think, though, that once you have installed a VM on your computer, VB knows how to run an applet inside the internal JVM. Anyway it works. I get the applet object then activate it's 'show' method.
    Code:
    Dim yosef as Programmer
    more.list.AddItem "Java", vbMore
    yosef.AddList("VB", "C++", "Pascal", more.list)

  6. #6
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    I think the Web Browser control can be used in VB to get the work done.

    there is a control at www.activex.com :: OCX to run as JavaBeans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width