How to make multiple if statements
<p>I'm using processing with java mode and I want to make more than 32 if conditions when I make it like normal way like this </p>

<pre><code>If (-------- == --------){//dosomething}

Else If (-------- == --------){//dosomething}

Else If (-------- == --------){//dosomething}

Else If (-------- == --------){//dosomething}

Else If (-------- == --------){//dosomething}

Else {//dosomething}
</code></pre>

<p>But only the first condition works and the rest of conditions don't work 
Sometimes it gives me error " Eof " </p>

<p>I tried also this style </p>

<pre><code>If (-------- == --------){//dosomething}

Else {//dosomething} 

If (-------- == --------){//dosomething}
Else {//dosomething} 


If (-------- == --------){//dosomething}
Else {//dosomething} 
</code></pre>

<p>It also didn't works only the first if condition works </p>

<p>Note there is one time the gui didn't show the buttons or labels</p>

<p>How could I answer this how could I write many if conditions </p>

<p>this is example  the value of y1 and y comes from other device and changes one and zero when I press a hardware button this code is not complete but only the concept and also there is from y1 to y20 and from x1 to x20 only the first condition that works and I try all the rectangles with it</p>

<p>this is update for the question 
the full code </p>

<p>**in this code I use 17 pushbutton in order to read from them if it is pressed the rectangle color will be black and if it is not pressed the rectangle will be white , It works well but only for 9 inputs but the rest of the 17 didn't work ,please note that I checked all the inputs and all connections and they are working well  so how could I solve this **</p>

<pre><code>import processing.serial.*;
import cc.arduino.*;

Arduino arduino;
int x1 = 255;
int x2 = 255;
int x3 = 255;
int x4 = 255;
int x5 = 255;
int x6 = 255;
int x7 = 255;
int x8 = 255;
int x9 = 255;
int x10 = 255;
int x11= 255;
int x12 = 255;

void setup()
{
  size(780, 600);

  //println(Arduino.list());

  arduino = new Arduino(this, Arduino.list()[0], 57600);

    arduino.pinMode(13, Arduino.INPUT);
    arduino.pinMode(12, Arduino.INPUT);
    arduino.pinMode(11, Arduino.INPUT);
    arduino.pinMode(10, Arduino.INPUT);
    arduino.pinMode(9, Arduino.INPUT);
    arduino.pinMode(8, Arduino.INPUT);
    arduino.pinMode(7, Arduino.INPUT);
    arduino.pinMode(6, Arduino.INPUT);
    arduino.pinMode(5, Arduino.INPUT);
    arduino.pinMode(4, Arduino.INPUT);
    arduino.pinMode(3, Arduino.INPUT);
    arduino.pinMode(2, Arduino.INPUT);

}


void draw()

{ 

  roundRect(10, 10, 150, 90, x1);
  roundRect(180, 10, 150, 90, x2);
  roundRect(350, 10, 150, 90, x3);
  roundRect(520, 10, 150, 90, x4);

  roundRect(10, 120, 150, 90, x5);
  roundRect(180, 120, 150, 90, x6);
  roundRect(350, 120, 150, 90, x7);
  roundRect(520, 120, 150, 90, x8);

  roundRect(10, 230, 150, 90, x9);
  roundRect(180, 230, 150, 90, x10);
  roundRect(350, 230, 150, 90, x11);
  roundRect(520, 230, 150, 90, x12);


  ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(13) == Arduino.HIGH ) {
    x1=0;
  }                                                                                                       
  else if (arduino.digitalRead(13) == Arduino.LOW) {
    x1=255;
  }
  /////////////////////////////////////////////////////////////

  ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(12) == Arduino.HIGH ) {
    x2=0;
  }
  else if (arduino.digitalRead(12) == Arduino.LOW) {
    x2=255;
  }
  /////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(11) == Arduino.HIGH ) {
    x3=0;
  }
  else if (arduino.digitalRead(11) == Arduino.LOW) {
    x3=255;
  }
  ///////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(10) == Arduino.HIGH ) {
    x4=0;
  }                                                                                                         
  else if (arduino.digitalRead(10) == Arduino.LOW) {
    x4=255;
  }
  ///////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(9) == Arduino.HIGH ) {
    x5=0;
  }
  else if (arduino.digitalRead(9) == Arduino.LOW) {
    x5=255;
  }
  //////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(8) == Arduino.HIGH ) {
    x6=0;
  }
  else if (arduino.digitalRead(8) == Arduino.LOW) {
    x6=255;
  }
  ///////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(7) == Arduino.HIGH ) {
    x7=0;
  }
  else if (arduino.digitalRead(7) == Arduino.LOW) {
    x7=255;
  }
  ////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(6) == Arduino.HIGH ) {
    x8=0;
  }
  else if (arduino.digitalRead(6) == Arduino.LOW) {
    x8=255;
  }
  /////////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(5) == Arduino.HIGH ) {
    x9=0;
  }
  else if (arduino.digitalRead(5) == Arduino.LOW) {
    x9=255;
  }

  ////////////////////////////////////////////////////////////////

  ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(4) == Arduino.HIGH ) {
    x10=0;
  }
  else if (arduino.digitalRead(4) == Arduino.LOW) {
    x10=255;
  }
  ///////////////////////////////////////////////////////////////

    ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(3) == Arduino.HIGH ) {
    x11=0;
  }
  else if (arduino.digitalRead(3) == Arduino.LOW) {
    x11=255;
  }
  //////////////////////////////////////////////////////////////

  ///////////////////////////////////////////////////////////////////////

  if (arduino.digitalRead(2) == Arduino.HIGH ) {
    x12=0;
  }
  else if (arduino.digitalRead(2) == Arduino.HIGH) {
    x12=255;
  }
  //////////////////////////////////////////////////////////////
}

void roundRect(float x, float y, float w, float h, float f) {

    float corner = w/10.0;
    float midDisp = w/20.0;

    fill(f);

    beginShape();  

    curveVertex(x+corner, y);
    curveVertex(x+w-corner, y);
    curveVertex(x+w+midDisp, y+h/2.0);

    curveVertex(x+w-corner, y+h);
    curveVertex(x+corner, y+h);
    curveVertex(x-midDisp, y+h/2.0);

    curveVertex(x+corner, y);
    curveVertex(x+w-corner, y);
    curveVertex(x+w+midDisp, y+h/2.0);

    endShape();

  } 
</code></pre>

<p><a href="https://i.stack.imgur.com/WCpds.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WCpds.png" alt="enter image description here"></a></p>