Ajp QB
Ajp QB
Ajp QB
In the Abstract Window Toolkit (AWT), layout managers are responsible for arranging and
resizing components (like buttons, labels, text fields, etc.) in a container (like a frame or
panel). Each layout manager follows a different strategy for placing the components in the
container.Here are some common AWT layout managers:
1. FlowLayout
2. BorderLayout
3. GridLayout
4. CardLayout
5. GridBagLayout
Program of GridBagLayout:
import java.awt.*;
import javax.swing.*;
// Create a label
Label label = new Label("Select your options:");
// Create a checkbox
Checkbox checkbox = new Checkbox("Agree to terms and conditions");
// Create a button
Button button = new Button("Submit");
Sr AWT SWING
No.
1 AWT components Java swing components
are platform-dependent. are platform-independent.
2 AWT components Swing components
are heavyweight. are lightweight.
3 AWT provides less Swing provides more powerful
components than Swing. components such as tables,
lists, scrollpanes, colorchooser,
tabbedpane etc.
4 MVC pattern is not supported by MVC pattern is supported by Swing.
AWT.
5 AWT components require java.awt Swing components requires javax.swing
package package
import java.awt.*;