Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » can't run applet with .html file
can't run applet with .html file [message #831856] Thu, 29 March 2012 12:52 Go to next message
Hannah Tipperman is currently offline Hannah TippermanFriend
Messages: 1
Registered: March 2012
Junior Member
I have written a java applet in eclipse which runs perfectly when I run it in eclipse with applet viewer.

As part of an online class (I am in 9th grade and trying to learn java programming) I have to also run the applet via a ".html" file.

I wrote the following file in a text editor and saved it with a .html extension. I've tried putting it in the src folder, the bin folder and the workspace but no matter what I do when I double click on the .html file it just opens up a browser window and displays the text of the .html file rather than the browser.

Please let me know what I am doing wrong - is it a problem with the file path eclipse creates and I am not specifying the java.class correctly?

Thanks you.

html code follows:

<html>

<head>

<title>CardApplet</title>

</head>

<body>

<applet code="CardApplet.class"width=400 height=200></applet>

</body>

</html>
Re: can't run applet with .html file [message #834908 is a reply to message #831856] Mon, 02 April 2012 14:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 3/29/2012 8:52 AM, Hannah Tipperman wrote:
> I wrote the following file in a text editor and saved it with a .html
> extension. I've tried putting it in the src folder, the bin folder and
> the workspace but no matter what I do when I double click on the .html
> file it just opens up a browser window and displays the text of the
> .html file rather than the browser.

You should double-check whether it's really a .html file or if another
extension (.txt?) has been silently appended to it. In the location bar
of the browser window, does the URL end with the .html as you expect?

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Need help with Eclipse ADT (Android Developer Tools)
Next Topic:what lowest JDK supports 1.2 jdk
Goto Forum:
  


Current Time: Thu Apr 25 05:41:32 GMT 2024

Powered by FUDForum. Page generated in 0.08304 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top