Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Many class files resulting from one Java file.

Reply
Thread Tools

Many class files resulting from one Java file.

 
 
lrantisi
Guest
Posts: n/a
 
      11-27-2006
Dear friends.
I have an Applet in a java file. But the applet uses two other classes
inside the same .java file
When I compile that file, I get many .class files.
Now I want to put this applet on the web.
So I uploaded all the .class files that were generated from building
the original .java file.

Of course I have to put an HTML file, and inside the code of that HTML
file, I should indicate the required .class file of the Applet. But
what about the other .class file: They are already on the web, but the
browser will not know about them, it will know only about the .class
file of the Applet.

What is the solution to this problem, I tried an example and it didn't
work, and the problem , as I mentioned, is that the other .class files
are not mentioned inside the HTML file.
Is the Jar technology a solution, and how to do it.

Thank you all.

 
Reply With Quote
 
 
 
 
Mike Schilling
Guest
Posts: n/a
 
      11-27-2006

"lrantisi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Dear friends.
> I have an Applet in a java file. But the applet uses two other classes
> inside the same .java file
> When I compile that file, I get many .class files.


This happens when you use nested or inner classes.

> Now I want to put this applet on the web.
> So I uploaded all the .class files that were generated from building
> the original .java file.
>
> Of course I have to put an HTML file, and inside the code of that HTML
> file, I should indicate the required .class file of the Applet. But
> what about the other .class file: They are already on the web, but the
> browser will not know about them, it will know only about the .class
> file of the Applet.
>
> What is the solution to this problem, I tried an example and it didn't
> work, and the problem , as I mentioned, is that the other .class files
> are not mentioned inside the HTML file.
> Is the Jar technology a solution, and how to do it.


Yes. There's no need for an applet for be a single class file; in fact,
that would be quite unusual. Collect all of your class files into a jar
file (using the jar utility), and install that along with your html file.


 
Reply With Quote
 
 
 
 
Dag Sunde
Guest
Posts: n/a
 
      11-27-2006
lrantisi wrote:
> Dear friends.
> I have an Applet in a java file. But the applet uses two other classes
> inside the same .java file
> When I compile that file, I get many .class files.
> Now I want to put this applet on the web.
> So I uploaded all the .class files that were generated from building
> the original .java file.
>
> Of course I have to put an HTML file, and inside the code of that HTML
> file, I should indicate the required .class file of the Applet. But
> what about the other .class file: They are already on the web, but the
> browser will not know about them, it will know only about the .class
> file of the Applet.
>
> What is the solution to this problem, I tried an example and it didn't
> work, and the problem , as I mentioned, is that the other .class
> files are not mentioned inside the HTML file.
> Is the Jar technology a solution, and how to do it.
>


What didn't work?

As long as you put the additional (generated) .class files in the same
directory as your html and main (applet) .class file it should work.

The only thing the browser need to know about is the .class file
containing the code for the applet. Then the Applet itself will look
for the rest of the files.

You can wrapp all of the class files in a jar, but it should make *no*
difference.

You have to tell us what went wrong. What error messages (in the java
Console).

--
Dag.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      11-27-2006
Dag Sunde wrote:
....
> You have to tell us what went wrong. What error messages (in the java
> Console).


...What URL (is the broken page on the internet)?

Andrew T.

 
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
scope of generators, class variables, resulting in global na Nomen Nescio Python 12 02-28-2010 11:45 AM
many aspnet applications in one site? many Gloabal.asax files ok? dee ASP .Net 2 08-15-2005 03:07 AM
problems with decoding: resulting image is corrupt Bjorn Jensen Perl 2 03-22-2005 06:52 PM
ASP Control names in resulting HTML Anatoli Trifonov ASP .Net 5 06-07-2004 05:36 PM
Setting a Range Parameter in a crystal report and streaming resulting report as a pdf James Wallace ASP .Net 0 10-17-2003 04:42 PM



Advertisments