I think an applet FAQ would be awesome. It would be great also to have a section just dedicated to applets as their a lot of special considerations like bugs, tutorials, sizes, offline testing, focus. It seems like java for games could really take off by taking some of the flash market share.
As a beginner here are a list of the questions I have. I’ve answered what I’ve could, but I’m sure there are a ton more.
Flash v Java: advantages and disadvantages?
Warning! Reading this part might be a bit depressing, depending on your current time investment of Java. Flash is the king of the browser game market despite being proprietary and not as flavorful, smooth as Java.
http://www.java-gaming.org/index.php/topic,19373.0.html
Browser Penetration: (Portability of Java is practically meaningless by looking at this stat)
http://www.statowl.com/java.php Penetration: 54% with 1.6 + 19% with 1.5. Total 73%.
http://www.statowl.com/flash.php Penetration: 54% with 9. + 40 with 10. Total 94%
On a positive side, Java is going to allow you to move toward bigger and more complex games.
What size should my applet be?
According to this site, the most common browsing resolution as of March 2009 is 1024x768. I used Photoshop on Windows XP to measure the maximum available browsing height with tabs and task bar up: On Firefox I only had 535 pixels. (Width seems mostly irrelevant.)
According to the flash discussion <a href="http://www.triquitips.com/viewtopic.php?f=25&t=617>here, 640x480 seems to be the preference. Of course with vector graphics, flash may have more flexibility.
According to this <a href="https://www.mochiads.com/community/forum/topic/portals-and-game-sizes-list-of-portals-max-size>discussion that lists several flash portals, 640x480 is the max for a few but many go much larger. Width doesn’t seem to be much of an issue, often set at 800.
Beware of large file sizes as it will hurt performance.
Why is the size of the applet important?
Try playing this amazing <a href="http://www.rocksolidarcade.com/games/robokill/>game on low resolution like 1024.
Webstart versus Applet?
Consensus says applet; however both do different things. Applets should be great for in browser gaming with fast loading and keeping the visitors harddrive clean. Webstart is great for keeping a game up-to-date and cleaning installing your application. The full discussion can be found <a href="http://www.java-gaming.org/index.php/topic,20044.0.html>here.
How to double buffer with an applet?
I’ve found three code samples I like. It would be wonderful if a Java Guru could chime in on the quality of these.
http://www.naturalprogramming.com/javagui/BeatingHeartApplet.java
http://www.gamedev.net/community/forums/topic.asp?topic_id=405663
http://www.gamespp.com/java/gameProgrammingTutorial04.html
Which Java game frameworks support applets?
Slick
LWJGL
PulpCore
3DzzD
GTGE
http://www.jpct.net/forum2/index.php/topic,1247.0.html
JOGL --> Unknown.
(any others?)
How do I test my applet offline?
In an IDE, just add it to a frame. Something like this:
public static void main(String[] args) {
SampleApplet applet = new SampleApplet();
Frame frame = new Frame();
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
frame.add(applet);
frame.setSize(800,600);
frame.show();
applet.init();
applet.start();
}
In a browser, for a single class,
<applet code="SampleApplet.class" width="800" height="600"></applet>
In a browser, from a Jar:
<applet code="SampleApplet.class" archive="SampleJar.jar" width="800" height="600"></applet>
How to add files (images and sound) to a JAR?
In NetBeans, right click on the project. Select properties. Select the category named “Sources.” Click “Add Folder” under the Source Package Folder Section. Select your directories. The default is .. Hit okay.
How to load files (images and sound) from a URL?
(need help)
How to load files (images and sound) from a jar on a URL?
(need help)
How to setup your code to load from a hard drive or URL?
(need help)
What is the best sound player for uncompressed files?
Use AudioClip. Clip seems to be buggy.
What is the best sound player for compressed files like Ogg and MP3?
(need help)
How do I add my own art to the Java Loading screen?
https://jdk6.dev.java.net/plugin2/#LOADING_SCREEN
How can I drive traffic to my game?
<a href="http://jayisgames.com/>http://jayisgames.com/
<a href="http://www.123spill.no/>http://www.123spill.no/
http://www.javagametome.com
http://digg.com/
http://www.greatgamesexperiment.com/games/
Where can I attempt to sell my game to a portal?
http://www.heavygames.com/
http://www.freearcade.com/
http://www.arcadepod.com/java/
Not interested in money, just want to get the game out there to be played.
http://gamejolt.com
http://www.jars.com/
http://www.javashareware.com/
What are the know bugs?
Mac users have a tough time with 1.6.
Is there an explanation of the major browser crash bug? I know David Brackeen’s framework resolves this but his code was a bit over my head.
What is the difference between Applet and JApplet? Which to use?
On person says, Applet is the HeavyWeight component, just use Applet everywhere and forget about JApplet.
However, when I use a canvas for double buffer and use Applet, I get a nasty 8 pixel bar along the top of my application. JApplet does not have this issue.
Has Oracle’s purchase of Sun doomed Java Games?
How to write to a server for things like high scores, save data, etc?
This allows folks to communicate with perl etc on the server side.