I’m trying to make a JTextField receive an array of numbers. I tryed with “for” and all the stuff needed to run an array, but without succes. Here is the piece of code.
private void cbxGeraValorActionPerformed(java.awt.event.ActionEvent evt)
{
if(cbxRandom.isSelected())
{
double[] num = new double[10];
for(int i=0; i<10; i++)
{
Random r = new Random();
num[i] = r.rnd;
txtValor.setText(String.valueOf(num[i]));
}
}
1 Answer