vorrei riscire a cambiare lo sfondo del jframe tramite il click del mouse ma non so come fare ecco il codice:
codice:
public class Finestra extends JFrame implements MouseListener {
    private int x, y;  
    boolean end=false;
    BufferedReader Tastiera = new BufferedReader(new InputStreamReader(System.in));
    public gestione g=new gestione();
    private JLabel la = new JLabel("clicca sullo schermo!",JLabel.RIGHT);
    
    public Finestra() {
        try {
        Robot robot = new Robot();
        //funzione esterna

        robot.delay(2000);
//qui di seguito ecco la stringa per il caricamento dell'immagine dello sfondo 
        BufferedImage image = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
       
        setSize(Toolkit.getDefaultToolkit().getScreenSize());
        JLabel label = new JLabel(new ImageIcon(image));
        
        setTitle("MouseTracer BY KiLlErBOMB");
        setLocation(0,0);
        
       
        add(label);

        addMouseListener(this);
        setVisible(true);
        }
catch (AWTException exception){}
"""""""""""e via dicendo...""""""""
    }