New to Java

I’ve always been interested on learning Java – Applets in particular – so that I could write my own simulations/games in such a way that they’re widely distributed. I’ve programmed using VB (including some single-player gaming, but stopped because I hated VB language), C++ (never got graphical on it), DHTML (errr… if you can call HTML/JS/CSS a “programming language”), and some server-side Web dev. stuff (CGI, ASP, CFM, PHP).

Just today I have finally downloaded and installed the SDK, etc., and wrote my first “Hello World” application and applet. I have a decent background on programming, game programming, including lots of game physics, yet I lack the basic Java knowledge. I thought of getting a book on it, but am not sure which way to go, since my focus is, at least at first, Applet/Games.

Any suggestions? – This could be books, websites, etc., or any thoughts in general on how I should approach the “next step”. Thanks in advance. :wink:

Welcome to the bord :slight_smile:

Just get a book. It doesn’t really matter wich one you pick (as long as it’s kinda recent). Once you’ve understood the basics of the language, you can move on. Then you can buy another (specialised) book or learn from online resources (like this bord ;)).

Its important to understand the different flavors of java so yo uknow yo uare learning the right stuff. Allthough the basic language syntax remains the same, the facilities available change a lot between all of the following:

Java 1.1 APPLETS

Pros: embed directly in the web page. All browsers come equipepd to deal with them.

Cons:
Must be programmed in Java1.1 (a very old dialect). Applets have seriosu limits on what they can do for security reasons. These limits can be gotten aroudn with “signed” applets but this takes a certificate from a certificate provider like Verisign and the cost isn’t insignificant.

Java 2 APPLETS

Pros:
Can use a modern dialect of Java (the latest if you want.)

Cons:
The same security restrictions as JDk1.1 Applets. Requries you deploy with Java PlugIn. User must either have already installed a mosern JRE or you need to make them download and install one. (JREs are kidna big currently though not as big as the JDK.)

Cell Phone CLDC/MIDP1.0 “Midlets”
Pros:
Highly available platform. Lots of commerical activity in this space.

Cons:
CLDC/MIDP1.0 is even more limited and primative then JDk1.1 Some cell phones have very serious size limitations on Midlets. Distribution is 100% controlled by the cell phone dialtone providers. They generally will only talk to major publishers so you will need to go through one of them.

Java Webstart Applications
Pros:
Can use the latest version of Java. Can be launched either from a web page or outside of the browser. Caches code on the suer’s side and manages updates for you reducing or eliminating subsequent download times after the first use. Much less limited security model then Applets. Can gain full system on user approval access without an expensive certificate.

Cons:
Can’t embed in the HTML page (they klaunch in their own frame.) Requries user have insatlled a recent JRE or that you make the user download and install one. JNLP files (what describes your program to Webstart) are not the most obviosu things in the world to figure out. To make really easy for all users requires that you have control over the web server or that someone who does installs the JNLP mine-type.

Full Applications on CD-ROM

Pros:
Can chose any JDK version you want and install it. Can use any extensions you want and install them as well.

Cons:
Cant web deploy except the way you deploy traditional apps (web installers and the like.)

Thanks for all the input so far. I’ve bought a book online and will wait for it to get here.

For now I’m shooting for learning the language syntax, etc., which will probably be done through something other than applets (a “regular” application), and then I’ll move into applets to work on the simulations and simple games I have in mind.

Once done with these, I might go deep into applications (non-applets), but for now I believe the applets will suffice, as I believe its security limits aren’t going to be an issue while developing my projects.

Once again, thanks! If anyone has anything else to add, please feel free to do so.

Using Java2 you can get really fast frame rates even in applets if the user has the latest jre in stalled.

Check out Adam Kings tutes here:

http://www.gamedev.net/reference/list.asp?categoryid=20#119

Thanks nonnus! Those tutorials have been a really good start before I get the book. It seems like they’re for Java 1.1 though, as some things on it are deprecated, such as size(), which is now getSize(). Everything else seems to work so far. Thanks a lot!