Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 3rd, 2005, 7:30 PM   #1
steven6666
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 steven6666 is on a distinguished road
Question Help With Applet

Hi, I just started using java a few days ago im still sorta just messing around learning some new things. I have made a simple applet that just displays simple "Hello World". Now I tried to changed the applet to say somthing else but it still says "Hello World". if i create a new .java file and a new .html file and then view it i see the new message but not if i just edit the old file that displayed "Hello World".

I know this is an extremly basic question and alot of you are probably laughing but ive been trying to figure it out for a while and I havnt gotten anywhere. Pelase help me.

Thanks
steven6666 is offline   Reply With Quote
Old Mar 3rd, 2005, 7:52 PM   #2
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Few questions.

1.) Are you sure you recompiled and it compiled without errors?
2.) Are you using JCreator, or some other IDE?
3.) I'm assuming you're viewing this from a web page, but I'm just making sure that you're doing that, and you're not using AppletViewer or something else.

Also, can you post the code.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Mar 3rd, 2005, 8:58 PM   #3
steven6666
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 steven6666 is on a distinguished road
Ya im postitive i recompiled wtihout any errors. I dont know what your talking about in question #2 and ya im viewing in a webpage.

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

public class hi extends Applet {
public void paint(Graphics g) {
g.drawString("Hello World!!!" ,50, 25);
}
}

And this is my HTML

<HTML>
<HEAD>
<TITLE>A Simple Program</TITLE>
</HEAD>
<BODY>
<APPLET CODE="hi.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
steven6666 is offline   Reply With Quote
Old Mar 8th, 2005, 8:55 AM   #4
BizzyC
Newbie
 
Join Date: Feb 2005
Location: Ireland
Posts: 5
Rep Power: 0 BizzyC is on a distinguished road
[quote=steven6666]
g.drawString("Hello World!!!" ,50, 25);
QUOTE]

See where it says "Hello World!!!", that's the string being printed, just change that text to print something else.
BizzyC is offline   Reply With Quote
Old Mar 21st, 2005, 10:50 AM   #5
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
If you did change that string and you're still getting the same message, maybe it's a cache thing. Your browser might be keeping a copy of the old version of the applet and displaying that even though the file has changed (it does this for speed: excuse me if I'm patronising you!).

If this is happening, what you do to fix it depends on the browser, but when it happened to me, just hitting reload didn't help (it reloaded the HTML but not the class file). I think it worked when I closed the browser and started it again, but you might have to clear the cache (on IE, go to your Internet Properties and on the General tab, under "Temporary Internet Files", hit "Delete Files" to clear the cache.
mackenga is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC