{"id":26922,"date":"2021-05-05T23:10:06","date_gmt":"2021-05-06T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/a-simple-button-that-contains-an-image-and-a-label-for-use-in-a-toolbar-programming-code-examples-java-j2ee-j2me-basic-swing\/"},"modified":"2021-05-05T23:10:06","modified_gmt":"2021-05-06T03:10:06","slug":"a-simple-button-that-contains-an-image-and-a-label-for-use-in-a-toolbar-programming-code-examples-java-j2ee-j2me-basic-swing","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=26922","title":{"rendered":"A simple button that contains an image and a label for use in a toolbar #Programming Code Examples #Java\/J2EE\/J2ME #Basic Swing"},"content":{"rendered":"<pre>\nToolBarButton.java A simple button that contains an image and a label for use in a toolbar. \nimport java.awt.*;\nimport javax.swing.*;\n\n\/** Part of a small example showing basic use of JToolBar.\n *  The point here is that dropping a regular JButton in a\n *  JToolBar (or adding an Action) in JDK 1.2 doesn't give \n *  you what you want -- namely, a small button just enclosing\n *  the icon, and with text labels (if any) below the icon,\n *  not to the right of it. In JDK 1.3, if you add an Action\n *  to the toolbar, the Action label is no longer displayed.\n *\n  *\/\n\npublic class ToolBarButton extends JButton {\n  private static final Insets margins =\n    new Insets(0, 0, 0, 0);\n\n  public ToolBarButton(Icon icon) {\n    super(icon);\n    setMargin(margins);\n    setVerticalTextPosition(BOTTOM);\n    setHorizontalTextPosition(CENTER);\n  }\n\n  public ToolBarButton(String imageFile) {\n    this(new ImageIcon(imageFile));\n  }\n\n  public ToolBarButton(String imageFile, String text) {\n    this(new ImageIcon(imageFile));\n    setText(text);\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=10313<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Basic Swing<br \/>Tags:Java\/J2EE\/J2MEBasic Swing<br \/> Post Data:2017-01-02 16:04:31<\/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>ToolBarButton.java A simple button that contains an image and a label for use in a toolbar. import java.awt.*; import javax.swing.*; \/** Part of a small example showing basic use of JToolBar. * The point here is that dropping a regular JButton in a * JToolBar (or adding an Action) in JDK 1.2 doesn&#8217;t give * &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=26922\">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-26922","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":10235,"url":"http:\/\/bangla.sitestree.com\/?p=10235","url_meta":{"origin":26922,"position":0},"title":"A simple button that contains an image and a label for use in a toolbar","author":"","date":"August 25, 2015","format":false,"excerpt":"ToolBarButton.java A simple button that contains an image and a label for use in a toolbar. import java.awt.*; import javax.swing.*; \/** Part of a small example showing basic use of JToolBar. \u00a0*\u00a0 The point here is that dropping a regular JButton in a \u00a0*\u00a0 JToolBar (or adding an Action) in\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":10237,"url":"http:\/\/bangla.sitestree.com\/?p=10237","url_meta":{"origin":26922,"position":1},"title":"Basic tool bar for holding multiple buttons.","author":"","date":"August 25, 2015","format":false,"excerpt":"BrowserToolBar.java A basic tool bar for holding multiple buttons. import java.awt.*; import javax.swing.*; \/** Part of a small example showing basic use of JToolBar. \u00a0*\u00a0 Creates a small dockable toolbar that is supposed to look \u00a0*\u00a0 vaguely like one that might come with a Web browser. \u00a0*\u00a0 Makes use of\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":26924,"url":"http:\/\/bangla.sitestree.com\/?p=26924","url_meta":{"origin":26922,"position":2},"title":"Basic tool bar for holding multiple buttons. #Programming Code Examples #Java\/J2EE\/J2ME #Basic Swing","author":"Author-Check- Article-or-Video","date":"May 5, 2021","format":false,"excerpt":"BrowserToolBar.java A basic tool bar for holding multiple buttons. import java.awt.*; import javax.swing.*; \/** Part of a small example showing basic use of JToolBar. * Creates a small dockable toolbar that is supposed to look * vaguely like one that might come with a Web browser. * Makes use of\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":10232,"url":"http:\/\/bangla.sitestree.com\/?p=10232","url_meta":{"origin":26922,"position":3},"title":"mall example showing the basic use of a JToolBar","author":"","date":"August 25, 2015","format":false,"excerpt":"mall example showing the basic use of a JToolBar import java.awt.*; import javax.swing.*; import java.awt.event.*; \/** Small example showing basic use of JToolBar. \u00a0* \u00a0* \u00a0*\/ public class JToolBarExample extends JFrame \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 implements ItemListener { \u00a0 private BrowserToolBar toolbar; \u00a0 private JCheckBox labelBox; \u00a0 public static void main(String[] args) {\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":26920,"url":"http:\/\/bangla.sitestree.com\/?p=26920","url_meta":{"origin":26922,"position":4},"title":"mall example showing the basic use of a JToolBar #Programming Code Examples #Java\/J2EE\/J2ME #Basic Swing","author":"Author-Check- Article-or-Video","date":"May 5, 2021","format":false,"excerpt":"mall example showing the basic use of a JToolBar import java.awt.*; import javax.swing.*; import java.awt.event.*; \/** Small example showing basic use of JToolBar. * * *\/ public class JToolBarExample extends JFrame implements ItemListener { private BrowserToolBar toolbar; private JCheckBox labelBox; public static void main(String[] args) { new JToolBarExample(); } 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":10271,"url":"http:\/\/bangla.sitestree.com\/?p=10271","url_meta":{"origin":26922,"position":5},"title":"Printing in Java 2","author":"","date":"August 26, 2015","format":false,"excerpt":"\u00a0\u00a0 * \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 o PrintExample.java Demonstrates printing a Graphics2D object. import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.awt.print.*; \/** An example of a printable window in Java 1.2. The key point \u00a0*\u00a0 here is that any component is printable in Java 1.2. \u00a0*\u00a0 However, you have to be careful to\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\/26922","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=26922"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/26922\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26922"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}