![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
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 |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
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> |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Feb 2005
Location: Ireland
Posts: 5
Rep Power: 0
![]() |
[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. |
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|