Minor Java Tutorials #1 - Getting Started & Sources

Started by lordryan756, March 18, 2012, 09:20:10 PM

Previous topic - Next topic

lordryan756

I have decided that I know enough to point the way to fellow Java Programmers. I will only type up the stuff that I know (A trivial amount, really). This amounts to mostly GUI related objects and facts, since I am only currently learning how to animate and create games. Hope you find this useful :P

Note - This is not finished. I will be adding bits of this and that when I recall them. Don't rush :P

1) First off, you need an IDE (Integrated Development Environment). This provides syntax errors and checking your code for you (Be warned, you will still need to de-bug it yourself ;) ). Some very useful IDEs are the Eclipse and Netbeans IDE. These are both different with different approaches. The Eclipse IDE is based FULLY on code. With the Netbeans, it is less code-dependent, as it has a drag-and-drop system, where you just drag the component to where you want it and then code the responses. I use the Eclipse IDE :P

2) You will then need to find a sufficient tutorial (Hopefully mine will suffice. If not, just go to the links at the bottom of this post). I will provide this to you over the coming pages.

3) A notepad (PAPER!!) and/or some note-cards to write down the bits that won't stick in your head! These will also be for fleshing out ideas and drawing/sketching prototype GUI (Graphical User Interface), such as where to put buttons, the text-boxes, etc. These can also be used to draw or visualize the interactions between each button and/or action. This will be very important when dealing with a lot of windows or different components.

Now that you have all of these, lets get going! Just as a note, I will be assuming you are using Eclipse, so you may need to translate to Netbeans :P.

Grammar and Syntax ( Please, for the mother of god, READ THIS PART FIRST):
Syntax in Java is a little funny. It is, however, a little more beginner friendly than the larger/more integrated languages (Depending on what you want to use it for). Here are some examples:

Semicolons ( ; ) - These must end EVERY LINE. I cannot stress this enough. You could write the MOST EPIC program ever, but if there are none of these, then you may as well have never thought of Java in the first-place. The only exception is when you are creating a "Method"(Discussed later). Please remember this!

Tabbing(Indenting) - Java components can be written in a straight, never-indenting line of code. But, guess what? Not everyone can read like this! This is what the tabbing is for. It easily organizes everything in relation to everything else. For example, if there were 2 line of code within a main body, they would be indented from the "Declaration" of that body, but they would both be next to each-other.

Some Sources ( For those cynically-inclined :P ):
http://www.eclipse.org - Download for the Eclipse IDE mentioned at the beginning of this post
http://www.netbeans.org - Download for the Netbeans IDE mentioned at the beginning of this post
http://www.youtube.com/thenewboston - Great beginners tutorial, but ends rather soon
http://www.java-gaming.org - A rather nice forum for those in need
http://www.tigsource.com - A good website with plenty of games and ideas

More tutorials will be coming up presently! Right now, just look around and familiarize yourself with the layout and feel. Also, if possible, watch the linked "TheNewBoston" Java tutorials. May take a bit of searching, since he does so many different tutorials :P