Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Applet doesn't display in browser (IE6)

Posted on 2002-07-04
8
Medium Priority
?
365 Views
Last Modified: 2010-03-31
I've just installed the J2SDK 1.4.0 and successfully got it to compile and run some examples from the Java tutorial, but now I want to get an applet to work.

It compiles without problem, but when I go to view it in IE6, it displays only a gray area that is the size specified in the <applet> tag. Why wouldn't it be loading?

I know Java is enabled and all because I could open up an applet from a tutorial I did like a year ago. Even when I take the exact same source code that was use for that working applet....if I compile it again in a different folder, then include that .class in an .html file, it displays nothing but a gray box.

(When I copy the .class file that works from the old folder to the new folder, and then open the .html file in the browser, it works, and then continues to work when I recompile the source code, but I think that's only because it uses the old .class file it has cached, because when I rename the class and all the filenames and try recompiling, it gives the same old gray rectangle.)

Also, I'm able to load all the applets I compile by using appletviewer, so it seems that the applet itself is okay. It must be something wrong with IE loading the applet? Has anyone had this problem before?

Oh, and I just tried it in Mozilla 1 and it works, so what's up with IE that it can't open my applets?

(OS: Win2000)
0
Comment
Question by:TylerRick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 9

Accepted Solution

by:
yongsing earned 400 total points
ID: 7131096
It's a versioning problem. A 1.4 compiled applet is not able to run in IE and Netscape, which are based on the 1.1 platform. Compile your code again with the -target option:

javac -target 1.1 YourApplet.java

This time, it should work.
0
 
LVL 92

Expert Comment

by:objects
ID: 7131311
Have a look in the Java console and see what the error is thats causing it to not start.
0
 
LVL 9

Expert Comment

by:yongsing
ID: 7131425
There are some new language features in 1.4. Sun doesn't want you to attempt running a 1.4 compiled code on a 1.1 VM. On Netscape, you will get a ClassFormatError. Beside compiling with the -target option, the alternative is to use the Java Plugin.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:CEHJ
ID: 7131677
First, you better check that you can run applets in IE6 at all http://www.w3.org/Protocols/Time/
ASFAIK IE6 comes *without* Java by default.
0
 
LVL 92

Expert Comment

by:objects
ID: 7133039
> IE6 comes *without* Java by default.

Only on XP.

But if J2SDK is installed then there's a good chance that the plugin is installed.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7133044
>>Only on XP

Got you
0
 
LVL 92

Expert Comment

by:objects
ID: 7133064
And they've recently announced that it will be included in the first service pack for XP.
0
 

Author Comment

by:TylerRick
ID: 7681764
I just noticed that this question was still open, so I'm just choosing an arbitrary answer. Sorry for not doing it sooner. I don't even remember what I did that got it to work, if I did.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question