Well I answer myself since I think the answer is this.
First to know that a JFrame is formed or composed of several layers. As you put it in this image
Where the components are really located is in this container called ContentPane and as it clearly shows in the image it is the one that is really worked on. Therefore, in order to add or make modifications, this container is made. So how do I access my container and be able to change, for example, the background color? Well, using the getContentPane method. From the newly I can change the background of the JFrame or JDialog that comes to be almost the same. Example:
NombreJFrame objetoJFrame = new NombreJFrame (this,true);
objetoJFrame.setBackground(Color.red); // De esta forma no estamos cambiando el color de fondo ya que no estamos trabajando sobre el contenedor donde se ubica los elementos
objetoJFrame.getContentPane().setBackground(Color.blue); // Como estamos obteniendo el contenedor del JFrame y es realmente donde se trabaja con los elementos, si que estariamos cambiando el color de fondo.
Here I leave another image to be able to clarify it more.