473,413 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Why does my Java applet not work?

mrjohn
32
I've been experimenting with this Java applet and Firefox, but after I recompile the code and refresh/reopen the page, the changes are not reflected in the browser. Why's that?

Expand|Select|Wrap|Line Numbers
  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4. public class Program extends Applet
  5. {
  6.     public void paint (Graphics g)
  7.     {
  8.         g.drawString("Hello World!", 125, 225);
  9.         //g.drawString("Good morning America.", 100, 100);
  10.         g.drawString("Hamster BBQ.", 50, 50);
  11.     }
  12. }
  13.  
When I comment or uncomment one of the lines (8 thru 10), the changes are not reflected in the browser. Why is this?
Here is the code in the HTML file I'm using.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.   <head>
  3.     <title>Java Test Program</title>
  4.   </head>
  5.   <body>
  6.     <applet code="Program.class" height=500 width=500></applet>
  7.     <div>TEST TEXT</div>
  8.   </body>
  9. </html>
  10.  
Sep 23 '09 #1
5 3783
Frinavale
9,735 Expert Mod 8TB
My best guess would be that you need to clear your browser cache.

:)

-Frinny
Sep 23 '09 #2
mrjohn
32
That doesn't seem to work, I'm afraid. I followed Firefox's instructions on how to clear the cache, but it doesn't seem to make any difference. Thanks anyhow.
Sep 24 '09 #3
r035198x
13,262 8TB
problem: I fixed some bugs and re-built my applet's source code. When i reload the applet's web page, my fixes are not showing up.

* you may be viewing a previously cached version of the applet. Close the browser. Open the java control panel and delete temporary internet files. This will remove your applet from cache. Try viewing your applet again.
. .
Sep 24 '09 #4
Your applet will obviously will not start because it strictly needs a init() method to run,init method is a method to run java applet..Visit these wonderful website if you want to learn java applet programming : [<links removed>
Oct 4 '09 #5
r035198x
13,262 8TB
@regan2007
Don't be silly. Read the posts in this thread. The applet is displaying. It's the changes that are not being picked up.

P.S I've removed your advertising links.
Oct 5 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: apchar | last post by:
I am trying to use php as a kind of servlet to act as a middle man between a java applet and mysql. I know java has jdbc but it's flakey and painful. php access to mysql is much nicer. So I have:...
8
by: Dave D | last post by:
I just read something that spooked me. I'm a newbie working my way through "SAMS Teach Youself Java 2 in 21 Days." I used to code a bit in Symantec's Visual Cafe for Java about 3 years ago, but...
1
by: edward hage | last post by:
Hello, I have a Linux machine and I use Netscape 7.1 which I upgraded from Mozilla. I downloaded j2sdj-1.4.2_02 and I have installed the plugins as followes: in .mozilla/plugins- directory a...
4
by: Warrick Wilson | last post by:
I've got a web page that uses frames. One of the frames loads an HTML page that redirects to a 3rd HTML page. This third page loads a Java applet - ProScroll.class - that runs a "news ticker"...
2
by: annie | last post by:
Hi all. Can Java classes/objects be used from within the javascript code on the HTML page? I.e., can I call a Java method from the javascript function? Thanks in advance Anna
2
by: Tim Murray | last post by:
First of all, I don't know much about Java, even its naming and version numbering nomenclature, and second, if there is a better group to ask this in, please let me know. System is Mac with...
3
tpgames
by: tpgames | last post by:
When I renamed the class file to Audiodriver.class and changed the link to Audiodriver.class, the game wouldn't load. I got this error java.lang.NoClassDefFoundError: Audiodriver (wrong name:...
3
by: Jimbo | last post by:
I have a website & applet produced under Windows-XP. It works fine. I took it to a machine running Windows 98 & an earlier version of Java to test what happens when I open the web page using IE6 &...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.