I would like to set the location of color1
to the size of a JPanel, in the same way I did with fundo
public static void janelaPrincipal()
{
//FRAME
JFrame janela = new JFrame();
janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
janela.pack();
janela.setResizable(false);
janela.setVisible(true);
janela.setSize(new Dimension(WIDTH, HEIGHT));
janela.setLocation((SCREEN.width / 2) - (WIDTH / 2), (SCREEN.height / 2) - (HEIGHT / 2));
Container c = janela.getContentPane();
c.setLayout(new FlowLayout());
//PAINEIS
JPanel fundo = new JPanel();
fundo.setPreferredSize(new Dimension(WIDTH, HEIGHT));
fundo.setBackground(background);
//BOTOES
JButton color1 = new JButton();
JButton color2 = new JButton();
color1.setPreferredSize(new Dimension(WIDTHBUTTON, HEIGHTBUTTON));
color1.setLocation(HEIGHT / 2, WIDTH /2);
color1.setBackground(RED);
//ADICIONAR NO FRAME
c.add(fundo);
fundo.add(color1);
}