Import Java
Import Java
*;
GUI
//window.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class window {
static JFrame window = new JFrame();
static JButton b1;
static JCheckBox check;
static JLabel lb;
static Container content = window.getContentPane();
static JTextField txt;
// add button
b1= new JButton("Ok");
content.add(b1);
b1.setBounds(100, 50, 200, 200);
// check box
check = new JCheckBox("BSCS",false);
content.add(check);
// action of button
b1.addActionListener(new ActionListener() {
content.setBackground(Color.blue);
}
});
//checkbox event
check.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
b1.setEnabled(false);
}
});
}
}