I don't really like the way the code is written, I know it's written in a bad way, so is there a way to write this in an easier way? Maybe by making an array and loop through?

```
private JPanel pnl1; 
private JPanel pnl2; 
private JPanel pnl3; 
private JPanel pnl4; 
private JPanel pnl5; 

public void createGUI() {
    setSize(WIDTH, HEIGHT);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout(new BorderLayout());
    //Panel related code will go here
    pnl1 = createPanel(Color.blue);
    pnl2 = createPanel(Color.black);
    pnl3 = createPanel(Color.cyan);
    pnl4 = createPanel(Color.green);
    pnl5 = createPanel(Color.darkGray);
    this.getContentPane().add(pnl1, BorderLayout.EAST);
    this.getContentPane().add(pnl2, BorderLayout.WEST);
    this.getContentPane().add(pnl3, BorderLayout.SOUTH);
    this.getContentPane().add(pnl4, BorderLayout.CENTER);
    this.getContentPane().add(pnl5, BorderLayout.NORTH);

    repaint();
    this.setVisible(true);
}

private JPanel createPanel(Color c) {
    //Create a JPanel object and store it in a local var
    //set the background colour to that passed in c
    //Return the JPanel object
    JPanel jp = new JPanel();
    jp.setBackground(c);
    return jp;
}

```

Thank you