Here is my code - i want b1 to close the window when i press it
public class Main {
public static void main(String[] args) {
javax.swing.JFrame w1 = new javax.swing.JFrame();
javax.swing.JButton b1 = new javax.swing.JButton();
w1.setBounds(0,0,300,300);
java.awt.Container c = w1.getContentPane();
c.setLayout(null);
b1.setText("Exit");
b1.setBounds(100, 100, 100, 30);
c.add(b1);
w1.setVisible(true);
}
}
please insert the code needed to close the window when the exit button is clicked!
thank you so much