I am trying to control 4 LEDs and getting analog input from 4 contacts. The program is written in java, so to gain acces to the functions of arduino, such as AnalogRead() and setting an LED to high or low, would importing the processing library let the program use those functions?
I was also wondering, if the program, will be transferred to the arduino it self, or the java program will just pull the data from the pins?
Update: My suggestion is to first try communicating the Arduino with Processing by youself. This is what I describe below. If you want to jump straight to controlling the Arduino directly with Processing, the link provided by Binary Nerd is your best choice to get you started.
Update 2: Try this link as well: Netbeans and Processing
Arduino code runs on the Arduino, and Processing code runs on your computer. If you want to control your Arduino through Processing, you will most likely use the serial port, and create two programs. One, on the Arduino, might receive commands and perform actions (turn LEDs on or off), or send back answers. The other, in Processing, might send the Arduino the necessary commands and process it's answers in some way.
Here is a quick example I made for one LED and one analog input. This is untested code. Follow the steps. Once this has worked, you could try using Processing directly with the Arduino in Netbeans.
Step 1. Arduino
Step 2. Processing
Arduino code:
Processing code (runs on your computer).
The idea with using the processing library is that you upload a standard firmware program to the arduino and then use serial comms to access arduino functions using java and processing.
This article should get you going: Arduino and Processing
So in your Java program you could read the analog value from an input and change the value on an output pin based on that reading.