aspose file tools*
The moose likes Applets and the fly likes Can't accept parameters from an applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can Watch "Can New topic
Author

Can't accept parameters from an applet

Prosenjit Banerjee
Ranch Hand

Joined: Dec 18, 2002
Posts: 102
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.



Always say the TRUTH only
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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.


Ping & DNS - my free Android networking tools app
Prosenjit Banerjee
Ranch Hand

Joined: Dec 18, 2002
Posts: 102
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
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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

Joined: Dec 18, 2002
Posts: 102
Here is the html code.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
The applet tag is not being closed.
Prosenjit Banerjee
Ranch Hand

Joined: Dec 18, 2002
Posts: 102
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
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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

Joined: Dec 18, 2002
Posts: 102
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't accept parameters from an applet