Support Forums

Full Version: [TuT] Getting started with Java Programming!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Getting started with Java Programming!
Written by Soul Collector

Hello everyone.

In this tutorial you going to learn some basics, I'm not advanced Java programmer I only know basic comand's. Also I will show you how to setup & start with Java. It's really simple, but you will need to download Java, link it & download and install compiler. Java is really nice & easy programming language. It works on all Operating Systems : Windows, Mac, Linux & Solaris. When you become better Java programmer you can get job as programmer too. Like I said it's really nice & easy programming language but in my opinion it's best. Confusedmile:

I - Download & installing necessary drivers

First you will need to download some important drivers & applications. Well first we will need to download Java Development Kit version 6. You don't need to worry is it infected or not because you will download from their official website. Just click link and select your Operating System. For this example I will show you for Windows OS, so you select Windows and hit Download.

[Image: 2079n55.png]

When you finish with download, just install it now we will need setup something in Control Panel. Now go to:

Control Panel > then search for System > and then Advanced system settings > click Environment Variables... click New...(Second New... button) and link your JDK bin folder. Mine is installed in C drive so link is: C:\Program Files\Java\jdk1.6.0_17\bin and name Variable to Java.
[Image: 25fpyy0.png]
[Image: v9pbn.png]

Now you can test Java in your CMD, go to Start > Run > type in cmd > and write javac and if you get some crap about java that means you did it all good. :tongue:

II - Installing Compiler ~ NetBeans

NetBeans is best compiler ever for Java. You can also use Eclipse, it's text editor but it's for Console only. But in NetBeans you can make Normal Desktop application, console application & website application. Cool

We will download it from their official website, so you don't need to worry about infection. Go to this link and download it.
[Image: 2r3835s.png]

When you download it just start installation process. If you done everything correctly NetBeans will work fine.

III - NetBeans

Now you will learn more about NetBeans. There are few different types of Java applications. We are going to talk about Console Application's and Desktop application's.

Console Application

What's console application?

- A console application is a computer program designed to be used via a text-only computer interface, such as a text terminal, the command line interface of some operating systems or the text-based interface included with some Graphical User Interface (GUI) operating systems.

Hello World:
To make Hello World program, you will need to make New Class. Click File > New Project... > select Java Class > click Next, name it [b]NewClass and click Finish button.

Now, we will need to make new method.

Whats method? (Click to View)

So now just write this code inside your Class(NewClass):
Code:
public static void Main(String[]args){
        System.out.println("Hello, world");
    }

Desktop Application

What's desktop application?

- Application software is computer software designed to help the user to perform a particular task. Such programs are also called software applications, applications or apps. Typical examples are word processors, spreadsheets, media players and database applications.

Hello World:
To make Hello World program, you will need to make Desktop Application. Click File > New Project... > select Java Desktop Application > click Next, name it [b]DesktopApplication1 and click Finish button.

We will need jButton1 also!

At the top of the code write:
Code:
import javax.swing.*;
import java.awt.event.*;

And now inside our method DesktopApplication1 write:
Code:
JFrame frame;
  public static void main(String[] args){
    DesktopApplication1db = new DesktopApplication1();
  }

  public DesktopApplication1(){
    frame = new JFrame("Show Message Dialog");
    JButton button = new JButton("Click Me");
    button.addActionListener(new MyAction());
    frame.add(button);
    frame.setSize(400, 400);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public class MyAction implements ActionListener{
    public void actionPerformed(ActionEvent e){
      JOptionPane.showMessageDialog(frame,"Roseindia.net");
    }
  }

Website's, tutorials & code's:

http://java.sun.com/docs/books/tutorial/
http://www.javacoffeebreak.com/tutorials/index.html
http://www.cs.cmu.edu/~jch/java/optimization.html
http://www.apl.jhu.edu/~hall/java/Swing-...nting.html
http://www.javacoffeebreak.com/java101/java101.html
http://java.sun.com/developer/technicalA.../1.4regex/
http://www.vijaymukhi.com/vmis/java.html
http://java.sun.com/docs/books/tutorial/deployment/jar/
http://www.woodger.ca/jv_top.htm
http://www.webdeveloper.com/java/java_pr...ds_up.html
http://javaboutique.internet.com/
http://www.mandomartis.com/onlinecourses/courses.html
http://java.sun.com/developer/onlineTrai...index.html
http://www.cs.drexel.edu/~shartley/ConcP...index.html
http://www.artima.com/designtechniques/i...ation.html
http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html
http://java.sun.com/developer/onlineTrai...tract.html
http://www.javaworld.com/javaworld/jw-12...ckets.html
http://www.acm.org/crossroads/xrds4-2/serial.html
http://java.sun.com/developer/onlineTrai...g/JDCBook/
http://www.apl.jhu.edu/~hall/java/CGI-with-Java.html
http://java.sun.com/developer/onlineTrai...index.html
http://java.sun.com/developer/onlineTraining/rmi/
http://www.onjava.com/pub/a/onjava/excer...index.html

Hope you like it, please leave a comment with feedback and ideas.
More will be added soon, please if you post somewhere else
give credits to me, Soul Collector.
Thanks for this, not bad for the newbs in coding Java.

I myself have had previous experience in Java coding, creating a Private server about 2 years ago, at the age of 12.
Very nice tutorial. My Java is currently messed up, but I'm most likely going to get it fixed within a day or so.
My Mum is studying Java coding, maybe I will show these sites to her. Thanks!
Bookmarked, a very good tutorial for me as a beginner on the java front.

Sam you have a damn cool mum xD
Thanks for this tutorial Smile I am thinking about starting Java coding but I think I will struggle Sad.
This tutorial is awesome and explain everything in depth.
Good job and thanks.
Thanks for this, alot of my friends say Java is fun.
Very easy to follow TUT

Nicely Done
Nice Tut, Seems like you and Sol Editor put some effort into it.
Pages: 1 2 3 4 5 6