I am trying to create a float[] depending on the user selection. In the code below, the variable widths is not recognized outside the if block. How can I dynamically create a float[] or append a float[]?
if(!dangerCheckBox.isSelected()){
float[] widths = {100, 250, 70};
} else {
float[] widths = {100, 250, 70, 70};
}
Just put it outside.