JavaFx - How to get button array index if value is all the same

I have an issue when I tried to create multiple buttons with the same value of "x". How can I fix this issue or perhaps get the value of the buttons and then delete the specific element in an array with the same index as my button without deleting other elements as it loops through the for loop?

Button[] delButton = new Button[sizeOfIt]; //sizeOfIt is the size of array

for (int m=0; m
delButton[m] = new Button("x");


for(int x = 0; x < delButton.length; x++) {

delButton[x].setOnAction(new EventHandler() {

public void...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts

  • Older News
  • How to end this statement in java StackOverFlow (2 days ago) - I cant even end this ending statement without error existimport java.util.Arrays;BufferedReader dataIn=new BufferedReader (new InputStreamReader (;String a;int n=0;int array []= {98,9,212,21,11,49,63,70,100};System.out.print("My Values "+Arrays.toString(array));System.out.print("\nEnter Number: ");a=dataIn.readLine();array[n]=Integer.parseInt(a);if(array[n]==98) {System.out.print("The Index Number is 0");}if(array[n]==9)...
  • Sorting 2D String Array with BUBBLESORT in java StackOverFlow (3 days ago) - Similar questions have been asked but never about 2D String Arrays, therefore after trying for a long time I couldn't find what I wanted. I'm trying to sort a 2D...