setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ImageIcon img = new ImageIcon(getClass().getResource(ruta + "server.png")); JLabel fondo = new JLabel(img); JLayeredPane layered = new JLayeredPane();// objeto para colocar imagen de fondo ((JPanel) getContentPane()).setOpaque(false); //fondo.setBounds(200,0,248,238); fondo.setBounds(125, 25, img.getIconWidth(), img.getIconHeight()); // pegamos el fondo al LayerPane(.add) getLayeredPane().add(fondo, JLayeredPane.FRAME_CONTENT_LAYER);