-
Jar Files
I have an applet that works great on a local machine as a bunch of class
files. When I put it in a jar file, however, only some of the images in
the applet load up.
Is there something I can do (even in my HTML) to wait to run the applet
until the entire .jar file is downloaded (if this is my problem)?
I'd appreciate any suggestions.
Rocco
-
Re: Jar Files
I believe you can utilize the ImageObserver interface to receive notification
of when an image is completely downloaded to the browser.
sorry don't have any code for you to use.
cheers,
bob
Rocco Balsamo <balsar@rpi.edu> wrote:
>I have an applet that works great on a local machine as a bunch of class
>files. When I put it in a jar file, however, only some of the images in
>the applet load up.
>
>Is there something I can do (even in my HTML) to wait to run the applet
>until the entire .jar file is downloaded (if this is my problem)?
>
>I'd appreciate any suggestions.
>
>Rocco
>
-
Re: Jar Files
Rocco Balsamo <balsar@rpi.edu> wrote:
> I create a jar file and include the manifest file with the Main-Class atribute
but when I try to run the jar with java in the command line, say that not
found entry class point, Do you can say me what is the mistake
-
Re: Jar Files
Try using MediaTracker. When you do
MediaTracker mt = new MediaTracker;
mt.addImage(someimage,0);
mt.WaitForAll();
Your applet should wait till all is loaded that you added to mt.
(not sure of the correctness of this code).
Rocco Balsamo <balsar@rpi.edu> wrote:
>I have an applet that works great on a local machine as a bunch of class
>files. When I put it in a jar file, however, only some of the images in
>the applet load up.
>
>Is there something I can do (even in my HTML) to wait to run the applet
>until the entire .jar file is downloaded (if this is my problem)?
>
>I'd appreciate any suggestions.
>
>Rocco
>
-
Re: Jar Files
How are you getting the image instance? Are you using the getImage() method
of the Appletcontext? Use the method getResource() method to load the image
from the jar file. But you have to wait till the whole jar file gets downloaded.
You can do another thing to minimize the lag time split your class files
into different jar files. I hope this may help you.
Rocco Balsamo <balsar@rpi.edu> wrote:
>I have an applet that works great on a local machine as a bunch of class
>files. When I put it in a jar file, however, only some of the images in
>the applet load up.
>
>Is there something I can do (even in my HTML) to wait to run the applet
>until the entire .jar file is downloaded (if this is my problem)?
>
>I'd appreciate any suggestions.
>
>Rocco
>
-
Re: Jar Files
I have the same question!! When I try to execute, the "main" class cannot
be found. Let me know when you discover the secret to executing standalone
files packaged in .jar files.
I need this information quickly
Thanks,
flairn
* * *
"Rem" <r3ruiz@hotmail.com> wrote:
>
>Rocco Balsamo <balsar@rpi.edu> wrote:
>> I create a jar file and include the manifest file with the Main-Class
atribute
>but when I try to run the jar with java in the command line, say that not
>found entry class point, Do you can say me what is the mistake
-
Re: Jar Files
I have a solution for you:
>I have the same question!! When I try to execute, the "main" class cannot
>be found. Let me know when you discover the secret to executing standalone
>files packaged in .jar files.
If I understand correctly, your problem is in the manifest you are trying
to append. If you want to set the the main class whose method main() is called
when executing via java -jar MyApp then you need to set the following in
a text file:
Main-class: MyApp
save it as whatever you like in the same dir as your class files, just remember
the name. Notice the case of the word class (it has a lowercase "c"), this
is often the problem. Then run the jar tool with:
jar mcf main.txt MyApp.jar *.class
Now it should find the main class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks