devxlogo

Manually Positioning Buttons in a Java Applet

Manually Positioning Buttons in a Java Applet

You can use Java’s layout managers to maintain the relative position of objects in an applet without manually repositioning them as the applet’s size changes. However, you may occasionally want to stipulate absolute layout coordinates for objects such as buttons or other menu-related components. To do so, you must use the statement:

 SetLayout(null); 

Place the code where you would ordinarily specify the name of the layout manager. If you proceed without a layout manager, you also have to use the add and reshape methods to add, position, and size the component.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist