# Receiving int data as IntList

**URL:** <https://discourse.processing.org/t/receiving-int-data-as-intlist/15826>\
**Category:** Coding Questions\
**Created:** [November 26, 2019, 10:05am UTC](https://discourse.processing.org/t/receiving-int-data-as-intlist/15826 "2019-11-26T10:05:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 26, 2019, 1:31pm UTC](https://discourse.processing.org/t/receiving-int-data-as-intlist/15826/6 "2019-11-26T13:31:50Z")

</div>

> [@24stevek](#):
>
> Or if you have an alternative for getting numbers, please advise me.

when i started to make [this](http://kll.engineering-news.org/kllfusion01/downloads/RPI_processing34_418.jpg)  
i used the

```auto
import javax.swing.JOptionPane;

// for button menu ask setpoint input
// _________________________________________________________________ askI call: A = askI("A",A);
int askI(String ask, int I) {
  String r = JOptionPane.showInputDialog(null, "new Setpoint for "+ask+" (now "+I+" )", "Input (INT)", JOptionPane.QUESTION_MESSAGE);
  if (r == null ) { 
    print(" NULL "); 
    r = str(I);
  } // handle CANCEL
  try { 
    I = Integer.parseInt(r);
  } 
  catch(NumberFormatException e) { 
    println("you did not enter a int number!");
  }
  println("new "+ask, I);
  return I;
}

// _________________________________________________________________ askF call: A = askF("A",A);
float askF(String ask, float F) {
  String r = JOptionPane.showInputDialog(null, "new Setpoint for "+ask+" (now "+F+" )", "Input (FLOAT)", JOptionPane.QUESTION_MESSAGE);
  if (r == null ) { 
    print(" NULL "); 
    r = str(F);
  } // handle CANCEL
  try { 
    F = Float.parseFloat(r);
  } 
  catch(NumberFormatException e) { 
    println("you did not enter a int or float number!");
  }
  println("new "+ask, F);
  return F;
}

int a = 0;
float b = PI;
void setup() {
  a = askI("input a ", a);
  b = askF("input b ", b);
  println("a "+a+" b "+b);
}
void draw() {
}

```

---

_[View the full topic](https://discourse.processing.org/t/receiving-int-data-as-intlist/15826)._
