Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / February 2004

Tip: Looking for answers? Try searching our database.

[HELP] Mike Green please or Anyone???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay Canale - 16 Feb 2004 17:22 GMT
Okay,
   I have a CD that contains a large number of Applets that I have created
using Visual J++ 1.1. These Applets run off the CD through Internet Explorer
IE. What I want to do is to convert these Applets into J# Browser Controls
and to still have them run from the CD and IE.
   Now what I tried was, I took one of the Applets and converted all the
class files into a .DLL using Jbimp.exe. Then I took the html file that
launches the Applet and using TagConvert I was able to created a new html
file. I then copied the files to my wwwroot directory and tried to launch
the J# Browser Control through IIS. I was able to launch the Applet and
everything runs well, except that in my code I use a function to get a JPG
file and display it as a background image E.g. "img =
getImage(getDocumentBase(),"back.jpg");" and the background image doesn't
show.
   I then, for kicks, uploaded the files to my ISP and tried to launch the
Applet/BrowserControl off of the web. Well it worked great and all the
background .jpgs showed off the web, but not through IIS. Why is this?

I then took the files and copied them to a CD and tried to run the applet,
like before they were converted, and I get the page, but I get a blank box
where the Applet/Browser Control should be.

Now, how do I then take the now converted Applets and place them on a CD and
have it all work like before when they were just regular applets?

Why does everything work well when launched off the Web, but not off my
machine?

this may sound confusing, but it's even more confusing to me! Any help you
provide will be appreciated,

Jay

P.S. Now all of this is being run and developed on a Windows 2000 machine. I
recently installed on a new machine Windows XP. I installed the Microsoft
.NET Framework Redistributable, the J# Browser Control Security v1.1 and the
Microsoft .NET Framework on to this machine. I then tried to go to my
webpage, where on the Win2000 machine I was able to run the Applet, but on
the XP machine I got nothing. What am I doing wrong? I have the Browser
Control Security set to "On any Web site(not recommended)" and still nothing
shows up except a gray box.
Lars-Inge T?nnessen - 16 Feb 2004 18:51 GMT
Hi Jay,

Please use getCodeBase(), not getDocumentBase()

getDocumentBase() returns the complete address including file name of the
class file.
getCodeBase() returns only the path.

Example:  (Test.java)

import java.applet.Applet;
import java.awt.*;

public class Test extends Applet
{
   private Image picture;

   public void init()
   {
       setBackground(Color.white);
       setFont( new Font("SansSerif", Font.BOLD, 18) );
       picture = getImage( getCodeBase(), "BMWSparkPlug.jpg" );
       add( new Label("Hello") );
   }

   public void paint( Graphics g )
   {
       g.drawImage( picture, 0, 50, this );
   }
}

Signature

Regards,
Lars-Inge T?nnessen
http://emailme.larsinge.com
http://www.larsinge.com

> file and display it as a background image E.g. "img =
> getImage(getDocumentBase(),"back.jpg");" and the background image doesn't

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.