I have had an issue with making multiple variables, such as buttons, and having to define, access or modify them each separately. I have searched many times on how to access multiple variables without wasting so much space. As you'd expect, I probably am just wording this wrong.
Example for what I am referring to:
button1.setBounds(25 + insets.left, 50 + insets.top,
size.width + 75, size.height + 75);
button2.setBounds(172 + insets.left, 50 + insets.top,
size.width + 75, size.height + 75);
button3.setBounds(319 + insets.left, 50 + insets.top,
size.width + 75, size.height + 75);
button4.setBounds(25 + insets.left, 172 + insets.top,
size.width + 75, size.height + 75);
button5.setBounds(172 + insets.left, 172 + insets.top,
size.width + 75, size.height + 75);
button6.setBounds(319 + insets.left, 172 + insets.top,
size.width + 75, size.height + 75);
button7.setBounds(25 + insets.left, 294 + insets.top,
size.width + 75, size.height + 75);
button8.setBounds(172 + insets.left, 294 + insets.top,
size.width + 75, size.height + 75);
button9.setBounds(319 + insets.left, 294 + insets.top,
size.width + 75, size.height + 75);
I was thinking of a for loop, leaving the int, x, to follow the variable, but it wouldn't be referenced properly.
* EDIT ** I'm not specifically referencing to the layout of the buttons... I am referring on how to modify multiple variables at once, i.e. Button1-9 without having to individually reference them.
button1.setToolTipText("Click here to check for the missing Flight 307");
button2.setToolTipText("Click here to check for the missing Flight 307");
button3.setToolTipText("Click here to check for the missing Flight 307");
button4.setToolTipText("Click here to check for the missing Flight 307");
button5.setToolTipText("Click here to check for the missing Flight 307");
button6.setToolTipText("Is it here?");
button7.setToolTipText("Is it here?");
button8.setToolTipText("Is it here?");
button9.setToolTipText("Is it here?");
How would I modify button1-button5, and separately, button6-button9? I hope this helps