java.awt


1. Creating a Simple Window:

import java.awt.*;

public class SimpleWindow {
    public static void main(String[] args) {
        Frame frame = new Frame("My Window");
        frame.setSize(400, 300);
        frame.setVisible(true);
    }
}

2. Adding a Label to a Window:

import java.awt.*;

public class LabelWindow {
    public static void main(String[] args) {
        Frame frame = new Frame("My Window");
        frame.setSize(400, 300);
        Label label = new Label("Hello World!");
        frame.add(label);
        frame.setVisible(true);
    }
}

3. Adding a Button to a Window:

4. Creating a Panel with BorderLayout:

5. Adding Components to a Panel with BorderLayout:

6. Creating a Canvas and Drawing on it:

7. Creating a Custom Component:

8. Using a Font and FontMetrics:

9. Using an Image and ImageObserver:

10. Using a Color and ColorModel:

11. Creating a Menu and MenuBar:

12. Creating a Scrollbar:

13. Creating a TextArea:

14. Creating a TextField:

15. Creating a Choice:

16. Creating a Checkbox and CheckboxGroup:

17. Creating a Radio Button and ButtonGroup:

18. Using a List:

19. Using a JOptionPane for User Input:

20. Using a JDialog for Custom Dialogs:

21. Creating a Custom Graphics2D Shape:

22. Using AffineTransform for Geometric Transformations:

23. Using a GridLayout:

24. Using a FlowLayout:

25. Using a MigLayout:

26. Using a BorderLayout with Constraints:

27. Using a CardLayout:

28. Using a GridBagLayout:

29. Using a SpringLayout:

30. Using a TabbedPane:

31. Using a JSplitPane:

32. Using a JScrollPane:

33. Using a JTable:

34. Using a JTree: