{"id":27217,"date":"2021-05-14T23:10:06","date_gmt":"2021-05-15T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/places-a-panel-holding-100-buttons-in-a-scrollpane-programming-code-examples-java-j2ee-j2me-advanced-swing\/"},"modified":"2021-05-14T23:10:06","modified_gmt":"2021-05-15T03:10:06","slug":"places-a-panel-holding-100-buttons-in-a-scrollpane-programming-code-examples-java-j2ee-j2me-advanced-swing","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=27217","title":{"rendered":"Places a Panel holding 100 buttons in a ScrollPane #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing"},"content":{"rendered":"<pre>\nimport java.applet.Applet;\nimport java.awt.*;\n\n\/** Places a Panel holding 100 buttons in a ScrollPane that is\n *  too small to hold it.\n *\n  *\/\n\npublic class ScrollPaneTest extends Applet {\n  public void init() {\n    setLayout(new BorderLayout());\n    ScrollPane pane = new ScrollPane();\n    Panel bigPanel = new Panel();\n    bigPanel.setLayout(new GridLayout(10, 10));\n    for(int i=0; i&lt;100; i++) {\n      bigPanel.add(new Button(&quot;Button &quot; + i));\n    }\n    pane.add(bigPanel);\n    add(pane, BorderLayout.CENTER);\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=10325<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.applet.Applet; import java.awt.*; \/** Places a Panel holding 100 buttons in a ScrollPane that is * too small to hold it. * *\/ public class ScrollPaneTest extends Applet { public void init() { setLayout(new BorderLayout()); ScrollPane pane = new ScrollPane(); Panel bigPanel = new Panel(); bigPanel.setLayout(new GridLayout(10, 10)); for(int i=0; i&lt;100; i++) { bigPanel.add(new &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=27217\">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-27217","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":10282,"url":"http:\/\/bangla.sitestree.com\/?p=10282","url_meta":{"origin":27217,"position":0},"title":"Places a Panel holding 100 buttons in a ScrollPane","author":"","date":"August 26, 2015","format":false,"excerpt":"import java.applet.Applet; import java.awt.*; \/** Places a Panel holding 100 buttons in a ScrollPane that is \u00a0*\u00a0 too small to hold it. \u00a0* \u00a0 *\/ public class ScrollPaneTest extends Applet { \u00a0 public void init() { \u00a0\u00a0\u00a0 setLayout(new BorderLayout()); \u00a0\u00a0\u00a0 ScrollPane pane = new ScrollPane(); \u00a0\u00a0\u00a0 Panel bigPanel = new\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":26948,"url":"http:\/\/bangla.sitestree.com\/?p=26948","url_meta":{"origin":27217,"position":1},"title":"Creates three radio buttons and illustrates handling #Programming Code Examples #Java\/J2EE\/J2ME #Basic Swing","author":"Author-Check- Article-or-Video","date":"May 6, 2021","format":false,"excerpt":"JRadioButtonTest.java Creates three radio buttons and illustrates handling ItemEvents in response to selecting a radio button. import javax.swing.JRadioButton; import javax.swing.ButtonGroup; import java.awt.*; import java.awt.event.*; import javax.swing.*; \/** *\/ public class JRadioButtonTest extends JPanel implements ItemListener { public JRadioButtonTest() { String[] labels = {\"Java Swing\",\"Java Servlets\", \"JavaServer Pages\"}; JRadioButton[] buttons =\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":27209,"url":"http:\/\/bangla.sitestree.com\/?p=27209","url_meta":{"origin":27217,"position":2},"title":"A simple applet (JApplet) created in Swing. #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 javax.swing.*; \/** Tiny example showing the main differences in using * JApplet instead of Applet: using the content pane, * getting Java (Metal) look and feel by default, and * having BorderLayout be the default instead of FlowLayout. * *\/ public class JAppletExample extends JApplet { public\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":27217,"position":3},"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":[]},{"id":27227,"url":"http:\/\/bangla.sitestree.com\/?p=27227","url_meta":{"origin":27217,"position":4},"title":"Six buttons arranged in a 2 row x 3 column grid by GridLayout #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 14, 2021","format":false,"excerpt":"\/.\/.\/.\/.\/.\/.\/ GridTest.java Six buttons arranged in a 2 row x 3 column grid by GridLayout.GridLayout divides the window into equal-sized rectangles based upon the number of rows and columns specified. ****************** import java.applet.Applet; import java.awt.*; \/** An example of GridLayout. * \/.\/.\/.\/.\/.\/. public class GridTest extends Applet { public void\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":27225,"url":"http:\/\/bangla.sitestree.com\/?p=27225","url_meta":{"origin":27217,"position":5},"title":"BorderLayout divides the window into five regions #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 14, 2021","format":false,"excerpt":"# BorderTest.java Five buttons arranged by BorderLayout BorderLayout divides the window into five regions: NORTH, SOUTH, EAST, WEST, and CENTER. \/.\/.\/.\/.\/.\/.\/.\/.\/.\/.\/.\/.\/.\/ import java.applet.Applet; import java.awt.*; \/** An example of BorderLayout. * &&&&&&&&&&&&&&&&&&&&&&&&&&& public class BorderTest extends Applet { public void init() { setLayout(new BorderLayout()); add(new Button(\"Button 1\"), BorderLayout.NORTH); add(new Button(\"Button\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\/27217","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=27217"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/27217\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27217"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}