Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/05/2008, 08:43
vdpazmino
 
Fecha de Ingreso: mayo-2007
Mensajes: 210
Antigüedad: 17 años
Puntos: 8
Re: fondo a JDesktopPane?

Te dejo un codigo que te ayudara

Código PHP:
public class MainDesktopPane extends JDesktopPane{

    private 
Image image;
    
    public 
MainDesktopPane() {
        
super();
        
image = new ImageIcon(getClass().getResource("/images/logo.png")).getImage();
        
setBackground(new Color(696492));
    }

    @
Override
    
protected void paintComponent(Graphics g) {
        
super.paintComponent(g);
        
int h = (int)image.getHeight(null)/2;
        
int w = (int)(image.getWidth(null)/2);
        
g.drawImage(image, (int)getWidth()/w, (int)getHeight()/hnull);
    }

salu2