Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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  
  Help my game enter the web  (Read 1925 times)
0 Members and 1 Guest are viewing this topic.
Offline KaptenDavidsson

Junior Newbie





« Posted 2010-01-24 17:54:54 »

Hi!

I’ve made a platform game in Swing and it works pretty good on my computer. Now I would like to put it on my website for my friends to play it. Which way is the best?
Java applets: Extend Applet from the JFrame
Java Web Start: Don’t really know what this is. Does it require my friends to download special software?
Java FX: Don’t really know what this is either but from what I heard it is similar to an applet.

The game has to be able to communicate with mysql on the server, both write and read. Ideally it will be full screen.

Thanx
/KaptenDavidsson
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #1 - Posted 2010-01-24 19:24:30 »

Hi!

I’ve made a platform game in Swing and it works pretty good on my computer. Now I would like to put it on my website for my friends to play it. Which way is the best?
Java applets: Extend Applet from the JFrame
Java Web Start: Don’t really know what this is. Does it require my friends to download special software?
Java FX: Don’t really know what this is either but from what I heard it is similar to an applet.

The game has to be able to communicate with mysql on the server, both write and read. Ideally it will be full screen.

Thanx
/KaptenDavidsson

webstart is the way to go....

a quick google search showed this: http://showmedo.com/videotutorials/video?name=3190000&fromSeriesID=319
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #2 - Posted 2010-01-24 19:34:24 »

webstart is the way to go....

a quick google search showed this: http://showmedo.com/videotutorials/video?name=3190000&fromSeriesID=319
Except that WebStart's implementation is utter crap and the browser plugin is actually more stable these days, and not an unknown technology to the enduser/player.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 80
Projects: 15


★★★★★


« Reply #3 - Posted 2010-01-24 19:55:44 »

Riven you should really give jws a try on 1.6.0_18 (latest update) think they finally fixed the caching problems.
Offline Karmington

Senior Devvie


Medals: 1
Projects: 1


Co-op Freak


« Reply #4 - Posted 2010-01-24 19:57:55 »

Applet, to have communications it needs to be signed. This is not too difficult though.

Applet seems to be pretty good choice but most applets will not work on Opera browsers, and some Linux/Mac machines
seem to have problems with applets too. Our racing game would not start in browser in many people's machines,
but running them through 'appletviewer' from command line worked, but many people may find this difficult.

Applet to go fullscreen however will need some tricks, like popping a JWindow to get out of the browser window. I had trouble getting that to be stable when 'undecorated', and still haven't had time to figure it out.

Have seen a lot of ok Webstart applications and our old game was webstart, perhaps some explanations or link to thread already discussing it, as to why it is bad would be in order I guess.

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #5 - Posted 2010-01-24 20:01:23 »

kk, the reason I said jws, is because he is using a swing application, and I am guessing it runs in a window, and as far as I know he would have to change his code ot an applet to run it as an applet amd I right?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 80
Projects: 15


★★★★★


« Reply #6 - Posted 2010-01-24 20:07:05 »

Applet, to have communications it needs to be signed. This is not too difficult though.

applet don't have to be signed if they want to communicate with the server they are hosted on, and now they also have cross domain support, so no longer need to be signed to connect with any server.

http://weblogs.java.net/blog/joshy/archive/2008/05/java_doodle_cro.html

Applet to go fullscreen however will need some tricks, like popping a JWindow to get out of the browser window. I had trouble getting that to be stable when 'undecorated', and still haven't had time to figure it out.

not if you use a lwjgl applet or a library like slick Smiley
they have proper fullscreen support.

example of slick applet with fullscreen support here
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 840
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2010-01-24 20:07:16 »

Riven you should really give jws a try on 1.6.0_18 (latest update) think they finally fixed the caching problems.

That would really be nice. It takes roughly 6 months to get something like 25% penetration though.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline KaptenDavidsson

Junior Newbie





« Reply #8 - Posted 2010-01-27 19:15:51 »

Thanx alot everyone, your comments have been most helpful.

Judging from your answers it seems like both applets and jws will work so I might try both (I need to learn them anyway) but I started out trying applets. So far  I get it to work pretty good by just open my JFrame in the applet init block. I had to change my ImageIO.read(new File("bild.jpg")) to new URL(getDocumentBase(), "bild.jpg") and that part seems to work. My problem now is to connect to a mysql server. I think the database is on the same computer as the server but I'm not sure, I use one.com as my webhost. When I try to call Class.forName("com.mysql.jdbc.Driver") I get a noClassDefException. I think I can get it to work though.

/Mike
Offline JL235

JGO Coder


Medals: 10



« Reply #9 - Posted 2010-01-31 22:52:20 »

Don't communicate with the database directly, leave it private on the server!!!

Instead build a script (i.e. communicate.php) and place that on your site. To communicate to the server you make a HTTP GET request of the script passing in your arguments and what the script writes out is your response. This adds a layer of control between what those outside your server (including your applet and others) can and cannot ask your DB about. If you want lots of communication, then build it using lots of small scripts for handling each type of request.

If you have a search around JavaGaming about how to build highscore tables for applets then you'll find lots of discussion and advice on this subject.

Also standard Java doesn't come with a MYSQL driver (or didn't when I last used it). On the MYSQL site somewhere is a .jar file containing the driver which you'll need to download, upload to your site and then link to in the applet tag as a part of your applets codebase.

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.

rwatson462 (28 views)
2014-12-15 09:26:44

Mr.CodeIt (19 views)
2014-12-14 19:50:38

BurntPizza (35 views)
2014-12-09 22:41:13

BurntPizza (70 views)
2014-12-08 04:46:31

JscottyBieshaar (32 views)
2014-12-05 12:39:02

SHC (44 views)
2014-12-03 16:27:13

CopyableCougar4 (40 views)
2014-11-29 21:32:03

toopeicgaming1999 (108 views)
2014-11-26 15:22:04

toopeicgaming1999 (94 views)
2014-11-26 15:20:36

toopeicgaming1999 (29 views)
2014-11-26 15:20:08
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!