NullTest.java Explicit placement of five buttons with the layout manager turned off (set to null) ########################## import java.applet.Applet; import java.awt.*; /** Layout managers are intended to help you, but there * is no law saying you have to use them. * Set the layout to null to turn them off. * ******************* public class NullTest extends Applet { public void init() { setLayout(null); Button b1 = new Button("Button 1"); Button b2 = new Button("Button 2"); Button b3 = new Button("Button 3"); Button b4 = new Button("Button 4"); Button b5 = new Button("Button 5"); b1.setBounds(0, 0, 150, 50); b2.setBounds(150, 0, 75, 50); b3.setBounds(225, 0, 75, 50); b4.setBounds(25, 60, 100, 40); b5.setBounds(175, 60, 100, 40); add(b1); add(b2); add(b3); add(b4); add(b5); } }
Note: Brought from our old site: http://www.salearningschool.com/example_codes/ on Jan 2nd, 2017 From: http://sitestree.com/?p=10351
Categories:Programming Code Examples, Java/J2EE/J2ME, Layout Managers
Tags:Java/J2EE/J2MELayout Managers
Post Data:2017-01-02 16:04:35
Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada