{"id":27221,"date":"2021-05-14T23:10:06","date_gmt":"2021-05-15T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/checkboxes-programming-code-examples-java-j2ee-j2me-advanced-swing\/"},"modified":"2021-05-14T23:10:06","modified_gmt":"2021-05-15T03:10:06","slug":"checkboxes-programming-code-examples-java-j2ee-j2me-advanced-swing","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27221","title":{"rendered":"Checkboxes #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing"},"content":{"rendered":"<pre>\nCheckboxes.java Inherits from CloseableFrame.java. \n******************\nimport java.awt.*;\n\n\/.\/.\/.\/.\/.\/.\/.\/.\/.\/\n\npublic class Checkboxes extends CloseableFrame {\n  public static void main(String[] args) {\n    new Checkboxes();\n  }\n\n  public Checkboxes() {\n    super(&quot;Checkboxes&quot;);\n    setFont(new Font(&quot;SansSerif&quot;, Font.BOLD, 18));\n    setLayout(new GridLayout(0, 2));\n    Checkbox box;\n    for(int i=0; i&lt;12; i++) {\n      box = new Checkbox(&quot;Checkbox &quot; + i);\n      if (i%2 == 0) {\n        box.setState(true);\n      }\n      add(box);\n    }\n    pack();\n    setVisible(true);\n  }\n}\n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10335<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Advanced Swing<br \/>Tags:Java\/J2EE\/J2MEAdvanced Swing<br \/> Post Data:2017-01-02 16:04:35<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Checkboxes.java Inherits from CloseableFrame.java. ****************** import java.awt.*; \/.\/.\/.\/.\/.\/.\/.\/.\/.\/ public class Checkboxes extends CloseableFrame { public static void main(String[] args) { new Checkboxes(); } public Checkboxes() { super(&quot;Checkboxes&quot;); setFont(new Font(&quot;SansSerif&quot;, Font.BOLD, 18)); setLayout(new GridLayout(0, 2)); Checkbox box; for(int i=0; i&lt;12; i++) { box = new Checkbox(&quot;Checkbox &quot; + i); if (i%2 == 0) { box.setState(true); } &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27221\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1917],"tags":[],"class_list":["post-27221","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10286,"url":"http:\/\/bangla.sitestree.com\/?p=10286","url_meta":{"origin":27221,"position":0},"title":"Checkboxes","author":"","date":"August 26, 2015","format":false,"excerpt":"Checkboxes.java Inherits from CloseableFrame.java. ****************** import java.awt.*; \/.\/.\/.\/.\/.\/.\/.\/.\/.\/ public class Checkboxes extends CloseableFrame { \u00a0 public static void main(String[] args) { \u00a0\u00a0\u00a0 new Checkboxes(); \u00a0 } \u00a0 public Checkboxes() { \u00a0\u00a0\u00a0 super(\"Checkboxes\"); \u00a0\u00a0\u00a0 setFont(new Font(\"SansSerif\", Font.BOLD, 18)); \u00a0\u00a0\u00a0 setLayout(new GridLayout(0, 2)); \u00a0\u00a0\u00a0 Checkbox box; \u00a0\u00a0\u00a0 for(int i=0; i<12; i++) {\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27028,"url":"http:\/\/bangla.sitestree.com\/?p=27028","url_meta":{"origin":27221,"position":1},"title":"CheckboxGroups #Programming Code Examples #Java\/J2EE\/J2ME #AWT Components","author":"Author-Check- Article-or-Video","date":"May 8, 2021","format":false,"excerpt":"CheckboxGroups.java \/.\/.\/.\/.\/.\/.\/.\/.\/.\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ import java.applet.Applet; import java.awt.*; \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ public class CheckboxGroups extends Applet { public void init() { setLayout(new GridLayout(4, 2)); setBackground(Color.lightGray); setFont(new Font(\"Serif\", Font.BOLD, 16)); add(new Label(\"Flavor\", Label.CENTER)); add(new Label(\"Toppings\", Label.CENTER)); CheckboxGroup flavorGroup = new CheckboxGroup(); add(new Checkbox(\"Vanilla\", flavorGroup, true)); add(new Checkbox(\"Colored Sprinkles\")); add(new Checkbox(\"Chocolate\", flavorGroup, false)); add(new Checkbox(\"Cashews\"));\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26928,"url":"http:\/\/bangla.sitestree.com\/?p=26928","url_meta":{"origin":27221,"position":2},"title":"Simple example illustrating the use of check boxes #Programming Code Examples #Java\/J2EE\/J2ME #Basic Swing","author":"Author-Check- Article-or-Video","date":"May 5, 2021","format":false,"excerpt":"JCheckBoxTest.java Simple example illustrating the use of check boxes. import javax.swing.*; import java.awt.event.*; *\/ public class JCheckBoxTest extends JPanel implements ItemListener, ActionListener{ JCheckBox checkBox1, checkBox2; public JCheckBoxTest() { checkBox1 = new JCheckBox(\"Java Servlets\"); checkBox2 = new JCheckBox(\"JavaServer Pages\"); checkBox1.setContentAreaFilled(false); checkBox2.setContentAreaFilled(false); checkBox1.addItemListener(this); checkBox2.addActionListener(this); add(checkBox1); add(checkBox2); } public void actionPerformed(ActionEvent event) {\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27219,"url":"http:\/\/bangla.sitestree.com\/?p=27219","url_meta":{"origin":27221,"position":3},"title":"A Frame that can actually quit #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 14, 2021","format":false,"excerpt":"import java.awt.*; import java.awt.event.*; \/** A Frame that you can actually quit. Used as the starting * point for most Java 1.1 graphical applications. * public class CloseableFrame extends Frame { public CloseableFrame(String title) { super(title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); } \/** Since we are doing something permanent, we need * to call\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27178,"url":"http:\/\/bangla.sitestree.com\/?p=27178","url_meta":{"origin":27221,"position":4},"title":"Template illustrating the second approach for creating a class with thread behavior. #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 13, 2021","format":false,"excerpt":"Template illustrating the second approach for creating a class with thread behavior. In this case, the class implements the Runnable interface while providing a run method for thread execution. public class ThreadedClass extends AnyClass implements Runnable { public void run() { \/\/ Thread behavior here. } public void startThread() {\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27211,"url":"http:\/\/bangla.sitestree.com\/?p=27211","url_meta":{"origin":27221,"position":5},"title":"creating a simple Swing application using a JFrame #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 14, 2021","format":false,"excerpt":"JFrameExample.java Demonstrates creating a simple Swing application using a JFrame. As with a JApplet, components must be added to the content pane, instead of the window directly.import java.awt.*; import javax.swing.*; \/** Tiny example showing the main difference in using * JFrame instead of Frame: using the content pane * and\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27221"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27221\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27221"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}