Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

J# Browser Controls

0.00/5 (No votes)
14 Nov 2004 1  
A short article on how to compile J# Browser Controls

Sample Image - JBrowserExample.jpg

Introduction

This short hands on article will show you how to convert Java Applets written for the Sun JDK 1.1.4 into J# Browser Controls. A J# Browser Control is the equivalent to the Java Applets in the .NET world. Before any clients can view any J# Browser Controls, they must first install these redists in this order:

Client Computers

Developer Computers Alternative 1

Developer Computers Alternative 2

(Please notice that the Microsoft Visual Studio .NET/2002 IDE does not support J# Browser Controls.)

The latest J# Browser Controls version has support for offline viewing, which is nice for debugging on your local computer. This will allow you to view the web pages locally without running them through a web server.

The converting steps are done very quickly if the source Java Applet is written in the supported JDK 1.1.4 API. Here are the steps:

Compiling

A J# Browser Control consists of a DLL library. You can compile the Browser Control from the Java Applet source by doing:

C:\...\>vjc.exe /target:library /out:Applet.dll *.java

Hopefully, you did not get any errors, only an Applet.dll library file.

Editing the HTML Web Page File

You can include a J# Browser Control in nearly any web page by including the following line:

<OBJECT CLASSID="clsid:a399591c-0fd0-41f8-9d25-bd76f632415f" 

 WIDTH=300 HEIGHT=110

 ID=SkidPad

 VJSCODEBASE = "Applet.dll#skidpad" >
</OBJECT>

The CLASSID tag references the ActiveX control that runs the J# Browser Control. Do not edit this ID. If you edit this ID tag, the J# Browser Control will not work.

WIDTH and HEIGHT are the size in pixels.

VJSCODEBASE references the URL where the Browser Control is located and which class the applet lives in. "Applet.dll#skidpad" tells us the Applet.dll is located in the same directory as the html-file, and the "applet" is located in the skidpad class.

It Does Not Work!

Please check the following:

  • The redists (all three must be installed)
  • The supported API (JDK 1.1.4, please notice this is not 1.4.1)
  • The CLASSID and the VJSCODEBASE tag in the HTML page file.

References

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below. A list of licenses authors might use can be found here.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here