Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet Problems - Works in appletviewer but not ie

Reply
Thread Tools

Applet Problems - Works in appletviewer but not ie

 
 
michael.rygh@gmail.com
Guest
Posts: n/a
 
      12-14-2005
I finished the applet and everything works in using the applet viewer.
When I open the htm file that opens the java class, everything works
until I get to my high scores screen. when I click that button, It
reads from a file and sorts out the high scores and then compares to
the current users high score. nothing is written to a file. just read.

I am wondering why it wouldn't work in the htm file but would work
using appletviewer. If I make it a signed applet will it work? I
thought it didn't have to be signed if you are just reading from a file
not writing.

Anyone have any suggestions?

 
Reply With Quote
 
 
 
 
Dag Sunde
Guest
Posts: n/a
 
      12-14-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I finished the applet and everything works in using the applet viewer.
> When I open the htm file that opens the java class, everything works
> until I get to my high scores screen. when I click that button, It
> reads from a file and sorts out the high scores and then compares to
> the current users high score. nothing is written to a file. just read.
>
> I am wondering why it wouldn't work in the htm file but would work
> using appletviewer. If I make it a signed applet will it work? I
> thought it didn't have to be signed if you are just reading from a file
> not writing.


Yes, you need to sign it to do *any* file access.

If not, you would be able to read my
"passwors_and_pincodes.txt" file in my root folder...

Read or write doesn't matter.

--
Dag.


 
Reply With Quote
 
 
 
 
michael.rygh@gmail.com
Guest
Posts: n/a
 
      12-14-2005
Thanks Dag Sunde for the help.

ok i've signed other applets but this one isnt working.

either something isnt working or im forgetting something...

i gotta jar my class..

jar cvf quiz.jar quiz.class

then run my key tool...

keytool -genkey -alias quiz -validity 365

then enter all my info

then last i need to sign the jar file with the jarsigner

jarsigner quiz.jar quiz

is that all i need to do? i did all that and tried recompiling and it
didnt work. i went and deleted my keyfile and retried it and it still
didn't work.

I'm new to this so any help would be great if im missing anything.
Thanks.

 
Reply With Quote
 
Dag Sunde
Guest
Posts: n/a
 
      12-15-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Thanks Dag Sunde for the help.
>
> ok i've signed other applets but this one isnt working.
>
> either something isnt working or im forgetting something...
>
> i gotta jar my class..
> jar cvf quiz.jar quiz.class
>
> then run my key tool...
> keytool -genkey -alias quiz -validity 365
> then enter all my info


Hmmm... It is a long time since I used a self-signed
certificate, and I've never used keytool.
But as far as I remember you have to create
a "root" certificate, and import that so you become
your own CA.

Then you use that CA-certificate to create and sign your
code-signing certificate.
Only now, you have a certificate you can use to sign your jar.

The command line I use to create and sign a jar file in one shot is
like this:

signtool -k"My CommonName" -d. -Z"jarfilename.jar" -p"mypwd" signdir

I have alway used OpenSSL to create self-signed server certificates,
not code-signing. I use a commercial Verisign certificate for that.

Anyway, here's the process for OpenSSL:
http://www.dylanbeattie.net/docs/ope...ssl_howto.html

Maybe you can get something from that...

--
Dag.


 
Reply With Quote
 
michael.rygh@gmail.com
Guest
Posts: n/a
 
      12-15-2005
well i got it to work. and now when i click the high scores button. it
crashes the whole window.

i have it just quiz.htm and it crashes that window

and i uploaded it to my ftp and went to that website and ran the signed
applet and when i hit the "high scores".. it crashes the whole window
and closes it.

i guess im stuck and don't know what would cause that. any
suggestions/ideas would be appreciated. thanks for your time!

 
Reply With Quote
 
michael.rygh@gmail.com
Guest
Posts: n/a
 
      12-15-2005
well i found out why it crashes and i got it to stop but now i still
have a problem.

in my catch for reading from the file... some how it would throw and
error and my code has it do a system.exit if it does.

so now i removed the system.exit... and when it displays the high
scores... it just says null 0. cause obviously its not reading them..

i just dont understand how it worked through appletviewer but not
worked through regular html file. hmm.. thanks for the help!

 
Reply With Quote
 
Dag Sunde
Guest
Posts: n/a
 
      12-15-2005
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> well i found out why it crashes and i got it to stop but now i still
> have a problem.
>
> in my catch for reading from the file... some how it would throw and
> error and my code has it do a system.exit if it does.
>
> so now i removed the system.exit... and when it displays the high
> scores... it just says null 0. cause obviously its not reading them..
>
> i just dont understand how it worked through appletviewer but not
> worked through regular html file. hmm.. thanks for the help!


In Appletviewer, it is running as a local program, accessing files
locally.

How do you access the file you try to open? Post the file-reading
code.
How is your filename and path formatted?

--
Dag.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      12-16-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> in my catch for reading from the file... some how it would throw and
> error and my code has it do a system.exit if it does.


You cannot do a System.exit(n) form within an applet.
>
> so now i removed the system.exit... and when it displays the high
> scores... it just says null 0. cause obviously its not reading them..


Where is your applet? Give us the URL so we can see it
crash. Link to the code.

> i just dont understand how it worked through appletviewer but not
> worked through regular html file. hmm.. thanks for the help!


Could be due to a number of things.

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applet Problems - works in appletviewer not in browser jeffbruce Java 1 08-22-2008 04:59 AM
Problems with an Applet that works from appletviewer 418928@cepsz.unizar.es Java 1 02-04-2007 04:52 PM
Java Applet loading in Applet Viewer but not in HTML page Archana Java 1 10-24-2004 11:41 PM
[py2exe.i18n] English works, German works, but not French. What do I miss? F. GEIGER Python 3 08-06-2004 10:01 AM
Re: Strange Appletviewer/HTML difference problem... (please help) Steve Claflin Java 0 09-03-2003 03:46 AM



Advertisments