This is the code i have for one button setting its corresponding Jpanel to visible and the other jpanels to false.
private void twickenhamButtonActionPerformed(java.awt.event.ActionEvent evt) {
twickenhamPanel.setVisible(true);
wembleyPanel.setVisible(false);
ellandPanel.setVisible(false);
sandyPanel.setVisible(false);
mkPanel.setVisible(false);
EtihadPanel.setVisible(false);
villaParkPanel.setVisible(false);
stJamesPanel.setVisible(false);
millenniumPanel.setVisible(false);
leicesterPanel.setVisible(false);
kingsholmPanel.setVisible(false);
OlympicPanel.setVisible(false);
}
But how to i add all of these jpanels to an array, but also use their corresponding buttons to set them to visible when clicked?