Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (483)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Applet and Webstart: The simple and proper tutorial.  (Read 7900 times)
0 Members and 1 Guest are viewing this topic.
Offline DoubleBarrel

Senior Newbie





« Posted 2010-02-22 17:53:19 »

Hi everyone Grin, once again I come to you beloved java-enlightened Tongue and humbly implore your knowledge and advise Roll Eyes

Well, I've been practicing (and experimenting) for the last few months, building tiny fragments of - and complete minuscule games; always, of course using Java Kiss
Now comes a time when, I think should be practicing about deploying my (if it can be called so) "work". So I would really appreciate if you (any kind soul) could write a tutorial or direct me to some RECENT or at least still relevant tutorial/collections of tutorials about how to:

- write the necessary code so that games can be delivered with webstart.
- configure server settings, so that webstart technology can work.
- obtain other important things such as the public and private keys that are apparently needed for webstart to work.

Talking about deployment, and if its not too much Roll Eyes - a similar tutorial, or reference to a good tutorial about gaming APPLETS and the related server stuff (files to upload, special libraries to include etc) would be the cherry on the cake in a reply for this topic Smiley
 
The reason for posting this:

- though a lot of information lies on the net some is toooo technical; some is not complete or assumes the user already knows certain things
  about webstart. Cry
- Of all people, you people in here have deployed your stuff through webstart loads and loads of times so it should be pretty trivial for you to
  explain. Cool
- If you reply with a link to some external tutorial I can rest my mind that it is relevant to current times and it contains correct information - that
  hopefully is simple, detailed and will work. Wink

Please note the emphasis here is not which between applet or webstart is better or most reliable - I have listened to, read and got annoyed by
that theoretical stuff. A guide to get things work in both ways (applet and webstart) is the cry of the crowd  persecutioncomplex

Thank you very very much. Grin

And Java Goes On
Offline markmistry

Junior Member





« Reply #1 - Posted 2010-02-22 18:37:21 »

download this...

http://goldenstudios.or.id/products/utilities/jarmaker/index.php

i found it easy to setup and use..just fill in the required fields...it will create a jar and it can sign it too.you supply your own keys



this is my .jnlp file on my server , change the names to reflect your file names

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
<?xml version="1.0" encoding="utf-8"?> 

<jnlp
  spec="1.0+"
  codebase="http://kickassevolution.com/bm3source/webstart"
  href="kae.jnlp">
  <information>
    <title>KickAssEvolution's BloodMoney</title>
    <vendor>Mark Mistry</vendor>
    <homepage href="bm3source/webstart/index.html"/>
    <description>Free Multiplayer Online Fighting Game. KickAssEvolution'
s BloodMoney</description>
    <description kind="short">BloodMoney</description>
   
    <offline-allowed/>
  </information>
  <security>
  <all-permissions/>
  </security>
  <resources>
    <j2se version="1.6+"initial-heap-size="256m" max-heap-size="512m"/>
 
    <jar href="kae.jar"/>
  </resources>
  <application-desc main-class="bloodmoneyGameEngine"/>
</jnlp>



add this code to your index.html file or whatever .php etc etc

1  
2  
3  
4  
5  
6  
<TD> <applet code="testgamelauncher.class"
   archive="kae.jar"
   width="800" height="600">
<PARAM name="java_arguments" value="-Xmx512m">
</applet></TD>
<TD>


i use the gtge framework/api /library thing so i need this class file

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
// GTGE
import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;

public class testgamelauncher extends GameLoader {

    protected Game createAppletGame() {

        return new bloodmoneyGameEngine();
        //this is the name of my class with main method

    }

}


if you want your applet or jnlp to access your server


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
grant codeBase "http://www.kickassevolution.com/-" {

  permission java.io.FilePermission
 "coreservers.html", "read";
   permission java.io.FilePermission
 "gameservers.html", "read";
    permission java.io.FilePermission
 "highscores.html", "read";
   permission java.io.FilePermission
 "build.html", "read";
   permission java.io.FilePermission
 "chars.html", "read";
    permission java.io.FilePermission
 "missions.html", "read";
     permission java.io.FilePermission
 "trophys.html", "read";
      permission java.io.FilePermission
 "moves.html", "read";
 permission java.util.PropertyPermission "user.home", "read","write";
};



and in my abyss webserver config file i added these lines so it would know what a .jnlp file was...


1  
2  
3  
4  
5  
6  
7  
8  
         <mime>
            <ext>
               jnlp
            </ext>
            <type>
               application/x-java-jnlp-file
            </type>
         </mime>


all this info i found on google it took me a few days to find all the info and a few days to get it to work properly..good luck  Grin
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #2 - Posted 2010-02-22 19:12:41 »

*phew*, damn long post just to request an applet or jws tutorial  Grin

one of the nicest java web start tutorials can be found here http://www.cokeandcode.com/webstarthowto
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DoubleBarrel

Senior Newbie





« Reply #3 - Posted 2010-02-26 14:00:42 »

Thanks a million for your replies Grin

@markmistry

Thanks for sharing your "template" with me. I appreciate very much will definitely use it.  Cool

@kapta

The tutorial at coke and code is great. Simple and straight forward.  Wink

@both and everyone else:

A few other questions:

The tutorial at coke and code says the server must support MIME
Are there any other things that the server must have in order to support webstart? and
Could you please suggest a free web hosting service that offers such servers?

If a server supports webstart can I assume that I can also upload applets on it (that will work)?

To get resources from the server into my program when using webstart  I have to use Thread.currentThread().getContextClassLoader().getResource("resource");

Do I also have to this if I m using an applet and want to load stuff in it from the server?

Infinite thanks for helping!  Smiley

And Java Goes On
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #4 - Posted 2010-02-26 14:15:13 »

The tutorial at coke and code says the server must support MIME
Are there any other things that the server must have in order to support webstart? and
Could you please suggest a free web hosting service that offers such servers?

yes the JNLP Java Webstart Mime types should be set, ofcourse most free web hosting won't support this. Just see the part in the cokeandcode tutorials about using php to set the mime type for you, this should be the most widely support method. Just find a free host that supports php and then you can use jws with it.

If a server supports webstart can I assume that I can also upload applets on it (that will work)?

Applets (mostly) have nothing to do with server side, they work entirely based on the applet tag which will work if you have the java plugin enabled in your browser. They can work totally without any server side support.
Offline DoubleBarrel

Senior Newbie





« Reply #5 - Posted 2010-02-26 14:57:07 »

I just love you Kapta  Kiss Tongue

And Java Goes On
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #6 - Posted 2010-02-26 16:19:29 »

about the loading resources hting, yes. well, depends actually

if you are still using a jar then yes, because it is the same.


but if you just use the class files, then you dont have to, or atleast I dont think you do.

but just save yourself the hassle later, and use it Tongue
Offline TimB

Junior Member


Medals: 1
Projects: 1



« Reply #7 - Posted 2010-02-27 09:52:29 »

Has web start improved noticeably in the last few months?

I experimented with it a bit and it showed good potential - but when most computers and browsers don't seem to support it without the player having to fiddle around with their settings the "one click" approach falls over.

I'd rather forgo the benefits of web start and go with either an applet or an installer simply because that way I have a pretty good chance of the player actually being able to just "click on a link and go". Every step someone has to take between becoming interested and being able to try it is a chance for them to change their mind and decide they aren't that interested after all!
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #8 - Posted 2010-02-27 14:33:06 »

Has web start improved noticeably in the last few months?

no not really, applets on the other hand have improved massively.
Offline DoubleBarrel

Senior Newbie





« Reply #9 - Posted 2010-02-28 09:20:10 »

Goooood Morning Grin  (or whatever time it is when ur reading this)

Please correct me and have mercy upon my ignorance but is it ok for a person(like me) to assume security buttons and compatibility are webstart's lack of improvement when reading a post like the one above?

Mentioning compatibility, when i upload an applet correctly I don't have to worry about compatibility with different OSes right?

As for the fiddling with security to make browsers support webstart ... I can't recall any of that when setting up my pc's Sad. As far as i remember just a simple download and install of the jre from sun's website. Maybe any specific cases or browsers? I need to Know! Tongue haha
Anyways, this is not some sort of apology towards webstart. I m a novice and  inexperienced in the matter so what I do here is literally learn from you. 

Thanks again enjoy your Sunday! Smiley

And Java Goes On
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #10 - Posted 2010-02-28 11:16:23 »

IMHO, Applet have always been superior than Webstart and far away more compatible, they are even superior in their approach (embeded in the main browser) even if webstart was working very well I would always prefer deploy an Applet than its equivalent Webstartable application. (EDIT : imagine if flash was adding some kind of webstart posibilities ? would you use it ? would you like it ?)

Having said that the main problem with Applet come from little change between JRE version, since several years now I found a "Working case" for any JRE (1.1 to current one) & browser combination, and then always use the same wich is :
=> use of APPLET TAG whenever it is possible (may not work in some fashist HTML strcit mode , just dont use this mode ... )
=> no codebase attribute : root of the applet is where the HTML reside (from the beginng codebase has been a source of confusion, and I have even seen Applet on sun website that did not work anymore after a JRE update because they got a codebase)
here is a typical Applet tag
1  
<APPLET code="MyApplet" archive="myAppletArchive.jar" style="width:600;height:400"><DIV>you must have java blabla... click here to install http://java.com</DIV></APPLET>

jar archive contain all classes but about images/sound/movie and any other multimedia ressource ...  I strongly recommend to let them outside of any jar on a subdirectoy of your applet html directory

EDIT: I would also recommend to use a custom applet booter as the one I ve posted in the shared section cause this way you can detect javaversion(or other pre-requierement ) and display you own warning while not being dependent on futur Sun/JRE "fancy idea"

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (19 views)
2014-08-22 19:31:30

atombrot (30 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (24 views)
2014-08-16 06:12:11

Rayexar (63 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (38 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!