{"id":2760,"date":"2017-12-05T07:52:28","date_gmt":"2017-12-05T07:52:28","guid":{"rendered":"http:\/\/webartdevelopers.com\/?p=2760"},"modified":"2018-06-27T15:11:42","modified_gmt":"2018-06-27T15:11:42","slug":"how-to-create-a-flow-layout-frame-in-core-java","status":"publish","type":"post","link":"https:\/\/webartdevelopers.com\/blog\/how-to-create-a-flow-layout-frame-in-core-java\/","title":{"rendered":"How to create a Flow Layout Frame in Core Java"},"content":{"rendered":"<p>In this tutorial how to create a Flow Layout Frame in Core Java is shown.<\/p>\n<p>Code:<\/p>\n<p>MyFlowLayout.java<\/p>\n<p>import java.awt.*;<br \/>\nimport javax.swing.*;<\/p>\n<p>public class MyFlowLayout<br \/>\n{<br \/>\nJFrame f;<\/p>\n<p>MyFlowLayout()<br \/>\n{<br \/>\nf = new JFrame();<\/p>\n<p>JButton b1 = new JButton(&#8220;1&#8221;);<br \/>\nJButton b2 = new JButton(&#8220;2&#8221;);<br \/>\nJButton b3 = new JButton(&#8220;3&#8221;);<br \/>\nJButton b4 = new JButton(&#8220;4&#8221;);<br \/>\nJButton b5 = new JButton(&#8220;5&#8221;);<\/p>\n<p>f.add(b1);<br \/>\nf.add(b2);<br \/>\nf.add(b3);<br \/>\nf.add(b4);<br \/>\nf.add(b5);<\/p>\n<p>f.setLayout(new FlowLayout(FlowLayout.RIGHT));<\/p>\n<p>f.setSize(300,300);<br \/>\nf.setVisible(true);<br \/>\n}<\/p>\n<p>public static void main(String[] args)<br \/>\n{<br \/>\nnew MyFlowLayout();<br \/>\n}<br \/>\n}<\/p>\n<p><a href=\"https:\/\/youtu.be\/93NS1dXQ40o\">https:\/\/youtu.be\/93NS1dXQ40o<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"In this tutorial how to create a Flow Layout Frame in Core Java is shown. Code: MyFlowLayout.java import java.awt.*; import javax.swing.*; public class MyFlowLayout { JFrame f; MyFlowLayout() { f = new JFrame(); JButton b1 = new JButton(&#8220;1&#8221;); JButton b2 = new JButton(&#8220;2&#8221;); JButton b3 = new JButton(&#8220;3&#8221;); JButton b4 = new JButton(&#8220;4&#8221;); JButton b5 = new JButton(&#8220;5&#8221;); f.add(b1); f.add(b2); f.add(b3); f.add(b4); f.add(b5); f.setLayout(new FlowLayout(FlowLayout.RIGHT)); f.setSize(300,300); f.setVisible(true); } public static void main(String args) { new MyFlowLayout(); } }<!-- AddThis Advanced Settings generic via filter on get_the_excerpt -->","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[156],"tags":[157,228,227],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/2760"}],"collection":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/comments?post=2760"}],"version-history":[{"count":3,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/2760\/revisions"}],"predecessor-version":[{"id":3172,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/2760\/revisions\/3172"}],"wp:attachment":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/media?parent=2760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/categories?post=2760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/tags?post=2760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}