I have this code, which creates a window and shows a JLabel in which I put an image; the image is large and only shows me a bit. I want to know how to resize the image to be displayed in small but complete.
package pruebasgraficas;
/**
*
* @author -Super Mario Bross-
*/
import javax.swing.*;
public class PruebasGraficas extends JFrame{
private static JLabel et1;
public static void main(String[] args)
{
JFrame Ventana1 = new JFrame();
Ventana1.setTitle("VENTANA 1");
Ventana1.setSize(600, 600);
Ventana1.setLocation(300, 100);
Ventana1.setVisible(true);
et1 = new JLabel();
et1.setSize(300, 300);
et1.setLocation(25,25);
et1.setIcon(new ImageIcon ( "logo.jpg" ) ) ;
Ventana1.add(et1);
Ventana1.setLayout(null);
Ventana1.repaint();
Ventana1.revalidate();
}
}