Applet won't work on the internet, yet it works on my hard drive!

S

Sudsy

gajo wrote:
Can someone tell me why isn't this working?

Wild guess? You did the FTP upload in ASCII mode. Change to
binary mode before the put and you should be good to go.
 
C

Chris Uppal

gajo said:
So what am I doing wrong? Is it that I have compiled with Java 1.4.1? I've
also uploaded the files on another web space provider, and it didn't work
there either.

I think that the classfile itself is OK, but that the problem is that you have
used some inner classes in your applet. Those classes get compiled into extra
..CLASS files and you have to upload them to the server too. You should find
files called reci$1.class, reci$2.class, and reci$3.class on your local drive
and those are the ones that are missing from the server.

However, I don't know if that will be enough to get your example working in all
browsers. If you are compiling for a Java 2 platform then I don't think the
applet will work in Internet Explorer if you are just using the old-style
"applet" tag (since it'll run on MS's old JVM rather than the Sun plugin).
Sun's tutorials should have examples of how to tell browsers how to use the
Java plugin. That should give you examples of how to package an applet with
several .CLASS files into a single .JAR file too.

-- chris
 
G

gajo

Chris Uppal said:
gajo wrote:
I think that the classfile itself is OK, but that the problem is that you have
used some inner classes in your applet. Those classes get compiled into extra
.CLASS files and you have to upload them to the server too. You should find
files called reci$1.class, reci$2.class, and reci$3.class on your local drive
and those are the ones that are missing from the server.

Yes, that fixed the problem! Yaaaay!!! Thanks alot! Everyone marvel at my
word-guessing game! :
http://www.icarusindie.com/juszuf7/progs/pogadjanje_reci.html
Hmm.. Interesting how none of my professors said anything about this, and I
haven't seen anything in the book either. Perhaps I did not read careful
enough...
However, I don't know if that will be enough to get your example working in all
browsers. If you are compiling for a Java 2 platform then I don't think the
applet will work in Internet Explorer if you are just using the old-style
"applet" tag (since it'll run on MS's old JVM rather than the Sun plugin).
Sun's tutorials should have examples of how to tell browsers how to use the
Java plugin. That should give you examples of how to package an applet with
several .CLASS files into a single .JAR file too.

There is an app called htmlconverter which makes all kind of weird tags that
I should put in my browser, but as I've said I checked my applet with IE 6
and the latest Opera and it worked ok.

Gajo
 
G

gajo

This is not that important, really. I have made my JTextBox to use the
Courier New font, and when I start the app with appletviewer it works ok.
But when I open the applet in IE or Opera, the font is back to the default,
which is ugly. Is there a way to use different fonts or is this something
that "can't be done due to security"?

Gajo
 
T

TT \(Tom Tempelaere\)

gajo said:
Chris Uppal said:
gajo wrote:
[...]
Yes, that fixed the problem! Yaaaay!!! Thanks alot! Everyone marvel at my
word-guessing game! :
http://www.icarusindie.com/juszuf7/progs/pogadjanje_reci.html
Hmm.. Interesting how none of my professors said anything about this, and I
haven't seen anything in the book either. Perhaps I did not read careful
enough...

It displays a grey box. Does that mean it doesn't work? (Win2k 5.00.2195
SP4, MS Internet Explorer 6.0.2800.1106 SP1, I guess the default JVM is used
I can't see where I can check the JVM).
There is an app called htmlconverter which makes all kind of weird tags that
I should put in my browser, but as I've said I checked my applet with IE 6
and the latest Opera and it worked ok.
Gajo

Not for me. (so not for everyone ;-)
 
G

gajo

Hi!

I have uploaded this (first in my life) applet on the Internet, along with
the HTML file for its viewing. On my hard drive I've opened the HTML with
Internet Explorer and Opera, and it works ok. Then I uploaded it on the
internet, and when I opened the Web site I got an "Invalid bytecode" message
in Opera. I've contacted the owner of the site and he says he has also
downloaded my html and .class on his hard drive and it ain't working for
him.
So what am I doing wrong? Is it that I have compiled with Java 1.4.1? I've
also uploaded the files on another web space provider, and it didn't work
there either.

This is the url:
http://www.freewebs.com/csabaland/java/pogadjanje_reci.html

You can also download the .class and .java, which is reci.java, and check it
out yourself.

Can someone tell me why isn't this working?

Gajo
 
G

gajo

Not for me. (so not for everyone ;-)

Seems your right. I've showed it to about 5-6 friends of mine on their
computers and it worked for all of them, but today when I checked it on the
university computer it didn't work. So I should put it in a JAR file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top