Good morning friends, is my first question on this website, I would like you to help me a little with this code ...
This is the code I am using, it returns the image with the initial dimensions of the jpanel; what I want is that by maximizing the window (when resizing the panel), the image is resized obtaining the new panel size.
Thanks for your help.
public Panel(JPanel jPanel){
this.x = jPanel.getWidth();
this.y= jPanel.getHeight();
this.setSize(x, y);
}
@Override
public void paint(Graphics g){
ImageIcon img = new ImageIcon(getClass().getResource("/iconos/fondo.jpg"));
g.drawImage(img.getImage(), 0, 0, x, y, null);
}