I have the frame
main% and a class panel
, what I want is to make several classes panel
and go putting them in the box. The frame
main% has a panel
already in series and would change. My problem is that everything is going well but the container (red background) does not fit the panel
(green).
This is my code:
{
MenuOperaciones Menu = new MenuOperaciones();
contenedor = panel0;
contenedor.removeAll();
contenedor.setBackground(Color.red);
Menu.setSize(panel0.getSize());
Menu.setBounds(panel0.getBounds());
contenedor.add(Menu);
contenedor.repaint();
contenedor.validate();
}