Author Topic: Eclipse and packaging jPCT with an applet  (Read 5217 times)

Offline Dan MacDonald

  • byte
  • *
  • Posts: 9
    • View Profile
Eclipse and packaging jPCT with an applet
« on: December 14, 2004, 06:15:15 am »
I realize this is slightly newbish, I just discovered jPCT and am pretty excited about making an applet based game with it. I also decided that it would be nice to learn eclipse at the same time. I've been able to get everything to run in eclipse by putting the jpct.jar in my workspace folder. However when I package up the applet in a jar using the "File/Export..." command, I'm having problems getting JPTC included properly. When I run the applet it fails, presumably because it's not linking to the JPTC classes (I can get a basic applet that doesn't use JPTC working just fine). Is there any special trick to this?

Offline Dan MacDonald

  • byte
  • *
  • Posts: 9
    • View Profile
Eclipse and packaging jPCT with an applet
« Reply #1 on: December 14, 2004, 10:13:27 am »
So I figured out how to get the com/treed/jpct/* includes in the jar using ANT, I'd still like to know how to do it from eclipse though, if anyone knows the special secret to getting the "com" folder to bundle up in the jar.

Offline oNyx

  • byte
  • *
  • Posts: 1
    • View Profile
Eclipse and packaging jPCT with an applet
« Reply #2 on: December 22, 2004, 10:19:16 pm »
Hey Dan :)

Well, there isn't such a thing like linking in Java.

Ok there are two ways to do it:

-pack everything into one jar

or

-just do it like you're doing it right now and just specify the other (jpct) jar in the applet tag like:

ARCHIVE   = "game.jar, jpct.jar"

Offline Dan MacDonald

  • byte
  • *
  • Posts: 9
    • View Profile
Eclipse and packaging jPCT with an applet
« Reply #3 on: December 23, 2004, 09:44:08 am »
Hello oNyx, nice to see a familiar face.

After looking at a number of the projects that are using jPct I have gotten greedy, I want to know how people are loading the class files dynamically. I've seen a  number of applets start with what appears to be a stub applet with a progress bar saying "loading..." as they load the various dependencies.  Are they loading jar's from the applet base dynamically?

I suspect they are, I'm going to have to look into that later... :)

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
applet loading
« Reply #4 on: December 24, 2004, 01:17:02 pm »
Applet packaging and preloading is a very delicate matter.

 Generic browsers store downloaded applets in browser cache. Once downloaded, the applet uses locally cached jars - this greatly reduces bandwidth consumption and startup time.

The general "progress bar" is a small applet which preloads all necessary jars for  the main applet. When all jars are loaded into browsers cache, the main applet starts up. Note that generic browser (i dont mean IE) does not cache resources loaded by applet itself. You still have to use javascript or some hidden frame to preload jars.

the current public technopolies version http://213.232.242.32/technopolies uses this approach to load necessary libraries at startup, but the upcoming version will load necessary jars at runtime.
Regards,
Andrei