{"id":901,"date":"2010-08-27T09:31:16","date_gmt":"2010-08-27T04:01:16","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=901"},"modified":"2010-08-27T09:31:16","modified_gmt":"2010-08-27T04:01:16","slug":"setbounds-method-not-working","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/java\/setbounds-method-not-working\/","title":{"rendered":"setBounds method not working"},"content":{"rendered":"<p>While working on Swings and AWT, i used the setBounds(int x,int y,int width,int height) method of control as per API documentation.<br \/>\nHowever soon i realized that this method is not working as per expected.<br \/>\nAfter few try i found that setBounds() method only works if <strong>the Layout of container of control is null.<\/strong><\/p>\n<p>The layout of the container can be set null like below code:<\/p>\n<blockquote><p>frame.getContentPane().setLayout(null);<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>SetBounds method of Swing and AWT controls are not working<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3],"tags":[46,329,192],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-java","tag-awt","tag-java","tag-swing"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":904,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/setbackground-not-working-in-swing-or-awt\/","url_meta":{"origin":901,"position":0},"title":"setBackground not working in Swing or AWT","author":"Jitendra","date":"August 27, 2010","format":false,"excerpt":"setBackground() not working for the JLabel control in JAVA","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":867,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/textbox-button-anonymous-actionlistener\/","url_meta":{"origin":901,"position":1},"title":"Event Handling using Anonymous Class in Applet","author":"Jitendra","date":"August 25, 2010","format":false,"excerpt":"Source code to demonstrate the usage of anonymous class in Applet","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"Event Handling using Anonymous Class in Applet ","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/08\/AnonymousClass1.jpeg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":862,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/textbox-button-anonymous-actionlistner\/","url_meta":{"origin":901,"position":2},"title":"Event Handling using Inner Class in Applet","author":"Jitendra","date":"August 25, 2010","format":false,"excerpt":"Demonstrates the example for handling event using Inner Class in Java Applet","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"Event Handling using Inner Class in Applet","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/08\/InnerClassButton.jpeg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":979,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/invoke-method-using-reflection-in-java\/","url_meta":{"origin":901,"position":3},"title":"Invoke method using reflection in JAVA","author":"Jitendra","date":"September 6, 2010","format":false,"excerpt":"Invoke method using reflection in JAVA","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1767,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/xml-tree-viewer-using-sax-parser-in-java-with-jtreejfilechooser-component-of-swing\/","url_meta":{"origin":901,"position":4},"title":"XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing, How to refresh Jtree when content changes , Expand or collapse JTree","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"XML Tree Viewer using SAX Parser in JAVA","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/03\/XML-Tree-Viewer-using-SAX-Parser-in-JAVA.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1943,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/what-is-the-need-to-override-hashcode-and-equals-method\/","url_meta":{"origin":901,"position":5},"title":"What is the need to Override Hashcode() and equals() method","author":"Jitendra","date":"April 11, 2011","format":false,"excerpt":"Although there are lots of material are available on internet and API document about the necessity of the overriding the hashcode() and equals() method in Java but lots of new developers still not able to understand the necessity of hashcode() method. In this article, I will try to explain step\u2026","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"How Hashcode works in java","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/04\/How-Hashcode-works-in-java.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":0,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}