TwoSqureComponent Java
TwoSqureComponent Java
*;
import java.awt.*;
//This class creates the main window and sets up the component for
drawing.
//This class extends JComponent and is responsible for drawing the two
squares.
class TwoSquareComponent extends JComponent {
//the paintComponent method to perform custom drawing
protected void paintComponent(Graphics g) {
// Call the superclass method to ensure proper rendering
super.paintComponent(g);