{"id":10319,"date":"2015-08-26T07:15:06","date_gmt":"2015-08-26T11:15:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=10319"},"modified":"2015-08-24T08:59:01","modified_gmt":"2015-08-24T12:59:01","slug":"java-nested-container-where-the-top-level-panels-are-positioned-by-hand","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=10319","title":{"rendered":"java Nested container where the top-level panels are positioned by hand"},"content":{"rendered":"<pre>######################\r\nButtonCol.java Nested container where the top-level panels are positioned by hand\r\n######################\r\nimport java.applet.Applet;\r\nimport java.awt.*;\r\n\r\n\/** An example of a layout performed manually. The top-level\r\n\u00a0*\u00a0 panels are positioned by hand, after you determine the size\r\n\u00a0*\u00a0 of the applet. Since applets can't be resized in most\r\n\u00a0*\u00a0 browsers, setting the size once when the applet is created\r\n\u00a0*\u00a0 is sufficient.\r\n\u00a0*\r\n\u00a0***************************\r\n\r\npublic class ButtonCol extends Applet {\r\n\u00a0 public void init() {\r\n\u00a0\u00a0\u00a0 setLayout(null);\r\n\u00a0\u00a0\u00a0 int width1 = getSize().width*4\/10,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 width2 = getSize().width - width1,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 height = getSize().height;\r\n\u00a0\u00a0\u00a0 Panel buttonPanel = new Panel();\r\n\u00a0\u00a0\u00a0 buttonPanel.setBounds(0, 0, width1, height);\r\n\u00a0\u00a0\u00a0 buttonPanel.setLayout(new GridLayout(6, 1));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Label(\"Buttons\", Label.CENTER));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Button(\"Button One\"));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Button(\"Button Two\"));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Button(\"Button Three\"));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Button(\"Button Four\"));\r\n\u00a0\u00a0\u00a0 buttonPanel.add(new Button(\"Button Five\"));\r\n\u00a0\u00a0\u00a0 add(buttonPanel);\r\n\u00a0\u00a0\u00a0 Panel everythingElse = new Panel();\r\n\u00a0\u00a0\u00a0 everythingElse.setBounds(width1+1, 0, width2, height);\r\n\u00a0\u00a0\u00a0 everythingElse.add(new Label(\"Everything Else\"));\r\n\u00a0\u00a0\u00a0 add(everythingElse);\r\n\u00a0 }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>###################### ButtonCol.java Nested container where the top-level panels are positioned by hand ###################### import java.applet.Applet; import java.awt.*; \/** An example of a layout performed manually. The top-level \u00a0*\u00a0 panels are positioned by hand, after you determine the size \u00a0*\u00a0 of the applet. Since applets can&#8217;t be resized in most \u00a0*\u00a0 browsers, setting the size once &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=10319\">Continue reading<\/a><\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1417,1424],"tags":[706,308,285],"class_list":["post-10319","post","type-post","status-publish","format-standard","hentry","category-code-programming-samples--","category-javaj2eej2me","tag-code","tag-java","tag-285","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":26787,"url":"http:\/\/bangla.sitestree.com\/?p=26787","url_meta":{"origin":10319,"position":0},"title":"java Nested container where the top-level panels are positioned by hand #Programming Code Examples #Java\/J2EE\/J2ME #Layout Managers","author":"Author-Check- Article-or-Video","date":"May 1, 2021","format":false,"excerpt":"###################### ButtonCol.java Nested container where the top-level panels are positioned by hand ###################### import java.applet.Applet; import java.awt.*; \/** An example of a layout performed manually. The top-level * panels are positioned by hand, after you determine the size * of the applet. Since applets can't be resized in most *\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":10308,"url":"http:\/\/bangla.sitestree.com\/?p=10308","url_meta":{"origin":10319,"position":1},"title":"Message.java Applet that reads customization parameters from an HTML file","author":"","date":"August 26, 2015","format":false,"excerpt":"******************* Message.java Applet that reads customization parameters from an HTML file ******************* import java.applet.Applet; import java.awt.*; **************** \u00a0 public class Message extends Applet { \u00a0 private int fontSize; \u00a0 private String message; \u00a0 \u00a0 public void init() { \u00a0\u00a0\u00a0 setBackground(Color.black); \u00a0\u00a0\u00a0 setForeground(Color.white); \u00a0\u00a0 \u00a0 \u00a0\u00a0\u00a0 \/\/ Base font size on\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":27249,"url":"http:\/\/bangla.sitestree.com\/?p=27249","url_meta":{"origin":10319,"position":2},"title":"Message.java Applet that reads customization parameters from an HTML file #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 15, 2021","format":false,"excerpt":"******************* Message.java Applet that reads customization parameters from an HTML file ******************* import java.applet.Applet; import java.awt.*; **************** public class Message extends Applet { private int fontSize; private String message; public void init() { setBackground(Color.black); setForeground(Color.white); \/\/ Base font size on window height. fontSize = getSize().height - 10; setFont(new Font(\"SansSerif\", Font.BOLD,\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":10279,"url":"http:\/\/bangla.sitestree.com\/?p=10279","url_meta":{"origin":10319,"position":3},"title":"BetterCircleTest.java","author":"","date":"August 26, 2015","format":false,"excerpt":"********************** BetterCircleTest.java ********************** import java.awt.*; import java.applet.Applet; \/** Position circles down the diagonal so that their borders \u00a0*\u00a0 just touch. Illustrates that Java 1.1 lightweight \u00a0*\u00a0 components can be partially transparent. \u00a0* \u00a0 *\/ public class BetterCircleTest extends Applet { \u00a0 public void init() { \u00a0\u00a0\u00a0 setBackground(Color.lightGray); \u00a0\u00a0\u00a0 setLayout(null); \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":10329,"url":"http:\/\/bangla.sitestree.com\/?p=10329","url_meta":{"origin":10319,"position":4},"title":"Position circles down the diagonal so that their borders","author":"","date":"August 26, 2015","format":false,"excerpt":"import java.awt.*; import java.applet.Applet; \/** Position circles down the diagonal so that their borders \u00a0*\u00a0 just touch. Illustrates that AWT components are \u00a0*\u00a0 rectangular and opaque. \u00a0 *\/ public class CircleTest2 extends Applet { \u00a0 public void init() { \u00a0\u00a0\u00a0 setBackground(Color.lightGray); \u00a0\u00a0\u00a0 setLayout(null); \/\/ Turn off layout manager. \u00a0\u00a0\u00a0 Circle\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":10212,"url":"http:\/\/bangla.sitestree.com\/?p=10212","url_meta":{"origin":10319,"position":5},"title":"Multithreaded Graphics and Double Buffering","author":"","date":"August 25, 2015","format":false,"excerpt":"ShipSimulation.java\u00a0 Illustrates the basic approach of multithreaded graphics whereas a thread adjusts parameters affecting the appearance of the graphics and then calls repaint to schedule an update of the display. \u00a0 import java.applet.Applet; import java.awt.*; public class ShipSimulation extends Applet implements Runnable { \u00a0 ... \u00a0 \u00a0 public void run()\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":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10319","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\/130"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10319"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10319\/revisions"}],"predecessor-version":[{"id":10320,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10319\/revisions\/10320"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10319"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}