// Find out the longest button...
double widest = 50;
for (int i = 0; i < buttons.size(); i++) {
Button btn = buttons.get(i);
if (btn == null) continue;
widest = Math.max(widest, btn.prefWidth(-1));
}
// ...and set all buttons to be this width
for (int i = 0; i < buttons.size(); i++) {
Button btn = buttons.get(i);