{"id":27219,"date":"2021-05-14T23:10:06","date_gmt":"2021-05-15T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/a-frame-that-can-actually-quit-programming-code-examples-java-j2ee-j2me-advanced-swing\/"},"modified":"2021-05-14T23:10:06","modified_gmt":"2021-05-15T03:10:06","slug":"a-frame-that-can-actually-quit-programming-code-examples-java-j2ee-j2me-advanced-swing","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27219","title":{"rendered":"A Frame that can actually quit #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing"},"content":{"rendered":"<pre>\nimport java.awt.*;\nimport java.awt.event.*;\n\n\/** A Frame that you can actually quit. Used as the starting \n *  point for most Java 1.1 graphical applications.\n *\n\npublic class CloseableFrame extends Frame {\n  public CloseableFrame(String title) {\n    super(title);\n    enableEvents(AWTEvent.WINDOW_EVENT_MASK);\n  }\n\n  \/** Since we are doing something permanent, we need\n   *  to call super.processWindowEvent <b>first<\/b>.\n   *\/\n  \n  public void processWindowEvent(WindowEvent event) {\n    super.processWindowEvent(event); \/\/ Handle listeners.\n    if (event.getID() == WindowEvent.WINDOW_CLOSING) {\n      \/\/ If the frame is used in an applet, use dispose().\n      System.exit(0);\n    }\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=10327<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>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 super.processWindowEvent first. *\/ public void &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27219\">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_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-27219","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":10284,"url":"http:\/\/bangla.sitestree.com\/?p=10284","url_meta":{"origin":27219,"position":0},"title":"A Frame that can actually quit","author":"","date":"August 26, 2015","format":false,"excerpt":"import java.awt.*; import java.awt.event.*; \/** A Frame that you can actually quit. Used as the starting \u00a0*\u00a0 point for most Java 1.1 graphical applications. \u00a0* public class CloseableFrame extends Frame { \u00a0 public CloseableFrame(String title) { \u00a0\u00a0\u00a0 super(title); \u00a0\u00a0\u00a0 enableEvents(AWTEvent.WINDOW_EVENT_MASK); \u00a0 } \u00a0 \/** Since we are doing something permanent,\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":10345,"url":"http:\/\/bangla.sitestree.com\/?p=10345","url_meta":{"origin":27219,"position":1},"title":"Handling Events","author":"","date":"August 27, 2015","format":false,"excerpt":"***********************************\u00a0\u00a0 \u00a0 * ActionExample1.java Inherits from CloseableFrame.java and uses SetSizeButton.java. \u00a0\u00a0\u00a0 * ActionExample2.java Inherits from CloseableFrame.java. \u00a0\u00a0\u00a0 ********************************************************** ActionExample1.java ******************* import java.awt.*; public class ActionExample1 extends CloseableFrame { \u00a0 public static void main(String[] args) { \u00a0\u00a0\u00a0 new ActionExample1(); \u00a0 } \u00a0 public ActionExample1() { \u00a0\u00a0\u00a0 super(\"Handling Events in Component\"); \u00a0\u00a0\u00a0\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":27022,"url":"http:\/\/bangla.sitestree.com\/?p=27022","url_meta":{"origin":27219,"position":2},"title":"Handling Events #Programming Code Examples #Java\/J2EE\/J2ME #AWT Components","author":"Author-Check- Article-or-Video","date":"May 8, 2021","format":false,"excerpt":"*********************************** * ActionExample1.java Inherits from CloseableFrame.java and uses SetSizeButton.java. * ActionExample2.java Inherits from CloseableFrame.java. ********************************************************** ActionExample1.java ******************* import java.awt.*; public class ActionExample1 extends CloseableFrame { public static void main(String[] args) { new ActionExample1(); } public ActionExample1() { super(\"Handling Events in Component\"); setLayout(new FlowLayout()); setFont(new Font(\"Serif\", Font.BOLD, 18)); add(new SetSizeButton(300, 200));\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":10363,"url":"http:\/\/bangla.sitestree.com\/?p=10363","url_meta":{"origin":27219,"position":3},"title":"ReverseLabels.java Inherits from CloseableFrame.java and uses ReversibleLabel.java.","author":"","date":"August 27, 2015","format":false,"excerpt":"ReverseLabels.java Inherits from CloseableFrame.java and uses ReversibleLabel.java. ********************** ReverseLabels.java ********************** import java.awt.*; ****************** public class ReverseLabels extends CloseableFrame { \u00a0 public static void main(String[] args) { \u00a0\u00a0\u00a0 new ReverseLabels(); \u00a0 } \u00a0 public ReverseLabels() { \u00a0\u00a0\u00a0 super(\"Reversible Labels\"); \u00a0\u00a0\u00a0 setLayout(new FlowLayout()); \u00a0\u00a0\u00a0 setBackground(Color.lightGray); \u00a0\u00a0\u00a0 setFont(new Font(\"Serif\", Font.BOLD, 18)); \u00a0\u00a0\u00a0 ReversibleLabel\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":10343,"url":"http:\/\/bangla.sitestree.com\/?p=10343","url_meta":{"origin":27219,"position":4},"title":"Uses a FileDialog to choose the file to display","author":"","date":"August 27, 2015","format":false,"excerpt":"DisplayFile.java **************** import java.awt.*; import java.awt.event.*; import java.io.*; \/** Uses a FileDialog to choose the file to display. \u00a0*************** \u00a0 public class DisplayFile extends CloseableFrame \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 implements ActionListener { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 public static void main(String[] args) { \u00a0\u00a0\u00a0 new DisplayFile(); \u00a0 } \u00a0 private Button loadButton; \u00a0 private TextArea\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":27050,"url":"http:\/\/bangla.sitestree.com\/?p=27050","url_meta":{"origin":27219,"position":5},"title":"ReverseLabels.java Inherits from CloseableFrame.java and uses ReversibleLabel.java. #Programming Code Examples #Java\/J2EE\/J2ME #AWT Components","author":"Author-Check- Article-or-Video","date":"May 9, 2021","format":false,"excerpt":"ReverseLabels.java Inherits from CloseableFrame.java and uses ReversibleLabel.java. ********************** ReverseLabels.java ********************** import java.awt.*; ****************** public class ReverseLabels extends CloseableFrame { public static void main(String[] args) { new ReverseLabels(); } public ReverseLabels() { super(\"Reversible Labels\"); setLayout(new FlowLayout()); setBackground(Color.lightGray); setFont(new Font(\"Serif\", Font.BOLD, 18)); ReversibleLabel label1 = new ReversibleLabel(\"Black on White\", Color.white, Color.black); add(label1);\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\/27219","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=27219"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27219\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}