Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't accept parameters from an applet

 
Prosenjit Banerjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please help me out receiving parameters from the following applet.
I have embedded the <applet> tag in my .java source code and when try to run it through the appletviewer it cannot accept any parameter passed. Using an .html file also gives the same result. Please help.

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting the parameters in the applet source code accomplishes nothing (the source is neither examined, nor is it generally available).

There are some exceptions later on, but reading the parameters works fine for me with the HTML you posted.
 
Prosenjit Banerjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could not get you. Kindly explain more.
I tried both from html and also the embedded tag in the source code. But none works.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your HTML file look like? (Don't bother posting the source file - applets are started from HTML files, not .java files.)
 
Prosenjit Banerjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the html code.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet tag is not being closed.
 
Prosenjit Banerjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that is the real mistake. But still the result is the same even after closing the applet tag. It cannot read the applet parameters. If you copy and pasted the code to execute, perhaps then you will understand what is going wrong.

[ January 26, 2008: Message edited by: Prosenjit Banerjee ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like I said, reading the parameters worked just fine for me.

There are some exceptions later due to incorrect program logic, though (the loops seem to run from 1 to 11 instead of 1 to 12, and element 0 of the arrays is not initialised).
 
Prosenjit Banerjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Mr. Dittmer for going through my code so carefully and giving me solutions. Now it runs correctly. :-)
[ January 26, 2008: Message edited by: Prosenjit Banerjee ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic