Source Code : JCheckBox is a widget that has two states. On and Off.
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
JCheckBox is a widget that has two states. On and Off.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
public class CheckBox extends JFrame implements ActionListener {
public CheckBox() {
JCheckBox checkbox = new JCheckBox("Show Title", true);
checkbox.addActionListener(this);
add(checkbox);
setSize(280, 200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new CheckBox();
}
public void actionPerformed(ActionEvent e) {
if (this.getTitle() == "") {
this.setTitle("Checkbox example");
} else {
this.setTitle("");
}
}
}
Thank with us